我正在尝试将我的本地开发部署到GitHub,并让我的Web服务器从Github中获取(工作正常)。
我将我的Laravel Repository从Github克隆到我的服务器。之后我运行composer install(工作正常)。 但是当运行npm install时,我收到以下错误:
npm ERR! Cannot read property 'length' of undefined
npm ERR! A complete log of this run can be found in:
npm ERR! /.npm/_logs/2017-11-12T14_48_59_351Z-debug.log
我检查了日志文件:它是空的。
此外,运行npm help config
等其他命令会引发此错误:
npm ERR! file man
npm ERR! path man
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn man
npm ERR! enoent spawn man ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! enoent Check if the file 'man' is present.
npm ERR! A complete log of this run can be found in:
npm ERR! /.npm/_logs/2017-11-12T14_49_57_777Z-debug.log
我刚通过命令行在我的共享主机上安装了node和npm。
npm -v
会产生5.5.1
任何想法如何解决这个问题?这可能是NPM中的错误吗?
修改
我尝试了其他几个节点& npm版本和node.js v7.10.1和npm 4.2.0至少npm install
开始运行。然后它产生以下错误(这使我得出结论,我需要一个新版本的npm,但较新版本抛出上述错误):
└── vuejs-datepicker@0.9.19
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 4.4.0-98-generic
npm ERR! argv "node" "/node-v7.10.1-linux-x64/bin/npm" "install"
npm ERR! node v7.10.1
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mozjpeg@4.1.1 postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mozjpeg@4.1.1 postinstall script 'node lib/install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the mozjpeg package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node lib/install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs mozjpeg
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls mozjpeg
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /.npm/_logs/2017-11-12T15_23_08_709Z-debug.log
如果没有安装新的npm版本,我可以解决这个问题吗?这对我也有帮助。我非常感谢任何帮助。 谢谢!