Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js npm安装和链接的问题_Node.js_Npm - Fatal编程技术网

Node.js npm安装和链接的问题

Node.js npm安装和链接的问题,node.js,npm,Node.js,Npm,在使用node和npm创建命令行应用程序时,我遇到了很多摩擦。我以前做过一些简单的项目,但现在乱用诸如npm-link之类的命令似乎让我陷入了麻烦 例如,现在尝试安装软件包时: alexanderbollbachs-MacBook-Pro:pmcli alexanderbollbach$ npm install cli-table --save npm ERR! Maximum call stack size exceeded npm ERR! A complete log of this r

在使用node和npm创建命令行应用程序时,我遇到了很多摩擦。我以前做过一些简单的项目,但现在乱用诸如
npm-link
之类的命令似乎让我陷入了麻烦

例如,现在尝试安装软件包时:

alexanderbollbachs-MacBook-Pro:pmcli alexanderbollbach$ npm install cli-table --save
npm ERR! Maximum call stack size exceeded

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/alexanderbollbach/.npm/_logs/2017-07-11T22_39_32_076Z-debug.log

正在运行npm链接:

Unhandled rejection RangeError: Maximum call stack size exceeded0.0~preinstall: no script for preinstall, c
    at exports.create (/usr/local/lib/node_modules/npm/lib/install/node.js:33:25)
    at /usr/local/lib/node_modules/npm/lib/install/node.js:36:14
    at Array.forEach (native)
    at exports.create (/usr/local/lib/node_modules/npm/lib/install/node.js:33:25)
    at /usr/local/lib/node_modules/npm/lib/install/node.js:36:14
    at Array.forEach (native)
    at exports.create (/usr/local/lib/node_modules/npm/lib/install/node.js:33:25)
    at normalizeTree (/usr/local/lib/node_modules/npm/lib/install.js:377:5)
    at Array.forEach (native)
    at normalizeTree (/usr/local/lib/node_modules/npm/lib/install.js:379:19)
    at Array.forEach (native)
    at normalizeTree (/usr/local/lib/node_modules/npm/lib/install.js:379:19)
    at Array.forEach (native)
    at normalizeTree (/usr/local/lib/node_modules/npm/lib/install.js:379:19)
    at Array.forEach (native)
    at normalizeTree (/usr/local/lib/node_modules/npm/lib/install.js:379:19)

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/alexanderbollbach/.npm/_logs/2017-07-11T22_42_51_880Z-debug.log
未处理的拒绝范围错误:最大调用堆栈大小超过0.0~预安装:没有用于预安装的脚本,c
在exports.create(/usr/local/lib/node_modules/npm/lib/install/node.js:33:25)
at/usr/local/lib/node_modules/npm/lib/install/node.js:36:14
at Array.forEach(本机)
在exports.create(/usr/local/lib/node_modules/npm/lib/install/node.js:33:25)
at/usr/local/lib/node_modules/npm/lib/install/node.js:36:14
at Array.forEach(本机)
在exports.create(/usr/local/lib/node_modules/npm/lib/install/node.js:33:25)
在normalizeTree(/usr/local/lib/node_modules/npm/lib/install.js:377:5)
at Array.forEach(本机)
在normalizeTree(/usr/local/lib/node_modules/npm/lib/install.js:379:19)
at Array.forEach(本机)
在normalizeTree(/usr/local/lib/node_modules/npm/lib/install.js:379:19)
at Array.forEach(本机)
在normalizeTree(/usr/local/lib/node_modules/npm/lib/install.js:379:19)
at Array.forEach(本机)
在normalizeTree(/usr/local/lib/node_modules/npm/lib/install.js:379:19)
npm错误!我从没打过电话!
npm错误!这是npm本身的一个错误。请通过以下地址报告此错误:
npm错误!
npm错误!此运行的完整日志可在以下位置找到:
npm错误/Users/alexanderbollbach/.npm/_logs/2017-07-11T22_42_51_880Z-debug.log


我希望你能深入了解问题所在。我已经读到,使用
自制
安装可能会导致问题。可能nodenpm配置不匹配。我确实在
~/.npm packages/bin
../lib/node mules/
目录中乱搞过,所以可能是我无意中删除了一些必要的文件(尽管这些文件应该在后续调用
链接时重新生成)。我也不完全确定link到底是做什么的,所以任何关于这个过程的澄清都会受到极大的欢迎

仅针对预防,安装最新的npm,“npm i-g npm”您所说的“仅针对预防”是什么意思?跟踪并通读此问题,看看是否能找到解决方案,如果不能,您可以将问题发布到那里。@AlexBollbach mmm排除与旧版本npm相关的可能错误:)