我在两台开发机器之间来回切换,最近两个版本都更新了节点,这基本上已经完成了整个节点项目的切换。在我的个人计算机上升级到v8之后,它打破了我的工作机器上的二进制文件,这个二进制文件仍然是6,所以在将它升级到8之后,再拉回我的个人计算机,它就完全坏了。
我尝试删除节点模块,清除npm缓存,重新安装节点模块等,根本没有任何工作,这都是因为这种愚蠢的幻像依赖。
编辑:大多数当我运行npm install
时,错误是它无法找到' isarray'但这里的示例列出了不同的依赖项。它是如此令人困惑,每次失败都有两个原因之一。
错误:
> phantomjs-prebuilt@2.1.16 install /Users/w/Turnout-V2/node_modules/phantomjs-prebuilt
> node install.js
module.js:487
throw err;
^
Error: Cannot find module 'request-progress'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/w/Turnout-V2/node_modules/phantomjs-prebuilt/install.js:9:23)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
npm WARN The package pug is included as both a dev and production dependency.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phantomjs-prebuilt@2.1.16 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs-prebuilt@2.1.16 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
更多日志:
2739 warn The package pug is included as both a dev and production dependency.
2740 verbose stack Error: phantomjs-prebuilt@2.1.16 install: `node install.js`
2740 verbose stack Exit status 1
2740 verbose stack at EventEmitter.<anonymous> (/Users/w/.nvm/versions/node/v8.0.0/lib/node_modules/npm/lib/utils/lifecycle.js:283:16)
2740 verbose stack at emitTwo (events.js:125:13)
2740 verbose stack at EventEmitter.emit (events.js:213:7)
2740 verbose stack at ChildProcess.<anonymous> (/Users/w/.nvm/versions/node/v8.0.0/lib/node_modules/npm/lib/utils/spawn.js:40:14)
2740 verbose stack at emitTwo (events.js:125:13)
2740 verbose stack at ChildProcess.emit (events.js:213:7)
2740 verbose stack at maybeClose (internal/child_process.js:887:16)
2740 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
2741 verbose pkgid phantomjs-prebuilt@2.1.16
2742 verbose cwd /Users/w/Turnout-V2
2743 verbose Darwin 17.5.0
2744 verbose argv "/Users/w/.nvm/versions/node/v8.0.0/bin/node" "/Users/w/.nvm/versions/node/v8.0.0/bin/npm" "install"
2745 verbose node v8.0.0
2746 verbose npm v5.0.0