我正在设置一个GitHub操作来自动链接和测试每个提交。不幸的是,当npm安装依赖项时,操作总是失败。
简而言之,我认为这个包有点混乱--lock.json,我需要以某种方式重新生成它。有什么想法吗?
误差
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/fsevents/-/fsevents-2.2.3.tgz
npm ERR! 404
npm ERR! 404 'fsevents@2.2.1' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-01-08T07_29_59_535Z-debug.log我相信这是包的这一部分的结果-lock.json
"fsevents": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.2.3.tgz",
"integrity": "sha512-bTLYHSeC0UH/EFXS9KqWnXuOl/wHK5Z/d+ghd5AsFMYN7wIGkUCOJyzy88+wJKkZPGON8u4Z9f6U4FdgURE9qA==",
"dev": true,
"optional": true
}注意URL与版本号是如何不同的。Fsevents从来没有2.2.3,只有2.2.2。
Fsevents不是该项目的直接依赖项(也就是说,它不在package.json中)。
调试步骤
我试过:
npm updatenpm audit fixnpm installnpm install --package-locknpm install之后恢复rm -rf node_modules && npm install,但是我在安装或运行测试时有任何问题。npm ci,就像操作一样,没有错误或问题。GitHub动作
如果这会产生影响,下面是GitHub操作:
name: Continuous integration
on: [push]
jobs:
test-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
- run: npm ci
- run: npm run lint
- run: npm run test错误发生在npm ci步骤上。
更新:我还在macOS上用runs-on: macos-latest尝试了Github。同样的错误。
发布于 2021-01-10 02:00:48
结果,我需要同时删除node_modules和package-lock.json。只做两个人中的一个就没用了。
rm -rm node_modules
rm package-lock.json
npm ihttps://stackoverflow.com/questions/65634090
复制相似问题