NPM无法处理节点js上的更新

2024-09-29 20:27:35 发布

您现在位置:Python中文网/ 问答频道 /正文

我在安装一个新的gulp项目时遇到了一些问题,所以我从node 0.12更新了我的节点,现在我面临着多个错误,在过去的2天里什么都没有工作。 我的节点版本是

C:\projects\newitpeople>node --version
v5.1.0

我的npm版本是

^{pr2}$

当我运行咕噜发球时,我得到的错误是

C:\projects\newitpeople>gulp serve
module.js:340
    throw err;
    ^

Error: Cannot find module './BufferUtil.fallback'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:289:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (C:\projects\newitpeople\node_modules\socket.io\node_modules\engine.io\node_modules\ws\lib\BufferUtil.js:12:20)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)

我正在处理这个link

我在运行npm install bufferutil时遇到这个错误

C:\projects\newitpeople>npm install bufferutil
npm WARN install Couldn't install optional dependency: Unsupported

> bufferutil@1.2.1 install C:\projects\newitpeople\node_modules\bufferutil
> node-gyp rebuild


C:\projects\newitpeople\node_modules\bufferutil>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_
modules\node-gyp\bin\node-gyp.js" rebuild )  else (node  rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\projects\newitpeople\node_modules\bufferutil\build\bufferutil.vcxproj(19,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not fo
und. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\projects\newitpeople\node_modules\bufferutil
gyp ERR! node -v v5.1.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "bufferutil"
npm ERR! node v5.1.0
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE

npm ERR! bufferutil@1.2.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bufferutil@1.2.1 install script 'node-gyp rebuild'.
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 bufferutil package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls bufferutil
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\projects\newitpeople\npm-debug.log

请帮助我清除这些,因为我已经为我的项目编写了代码,无法运行输出。在


Tags: installthemodulesnodenpmjsatprojects
1条回答
网友
1楼 · 发布于 2024-09-29 20:27:35

尝试删除node_模块并重新安装npm。在

奇数版本,例如Node 5.*也是具有最新功能的更快的短期支持版本。除非您在节点5中进行了特定的更改,否则您可能更喜欢移动到节点4.*因为它是更稳定的长期支持版本。节点5还包括NPM版本3,这对某些人来说很麻烦,而节点4仍然使用NPM 2。在

相关问题 更多 >

    热门问题