gpt4 book ai didi

node.js - npm 安装错误 - npm 错误! cb() 从未调用过,错误代码 0

转载 作者:太空宇宙 更新时间:2023-11-04 01:07:29 25 4
gpt4 key购买 nike

Windows 7 (64)npm 版本 1.3.24 Node 版本0.10.25

当我尝试安装 Bower 时,收到此错误消息

C:\>npm install bower -g
npm http GET https://registry.npmjs.org/bower
npm ERR! cb() never called!
npm ERR! not ok code 0

我已经尝试过

npm cache clean 

npm install - getting another error message 

Microsoft Windows [版本 6.1.7601]版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\andpon>cd/

C:\>npm install
npm ERR! install Couldn't read dependencies
npm ERR! package.json ENOENT, open 'C:\package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directo
ry.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! path C:\package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\npm-debug.log
npm ERR! not ok code 0

谁知道这个问题的解决办法

谢谢

最佳答案

我在博客中找到了一个条目,该条目通过创建符号链接(symbolic link)以以下简单的方式解决了该问题:

For anyone wishing to still use their OS's package of node the simple solution for this is to determine where node is installed on your OS and then create a symbolic link.

For example I had the issue on ubuntu and the install directory is /usr/bin. To create the symlink you can run:

sudo ln -s /usr/bin/nodejs /usr/bin/node

in windows you can use the mklink command.. Be sure to open the command prompt as a administrator

关于node.js - npm 安装错误 - npm 错误! cb() 从未调用过,错误代码 0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21721008/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com