NPM不使用节点js上的更新

时间:2015-11-21 16:56:01

标签: python node.js

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

C:\projects\newitpeople>npm --version
3.3.12

我的npm版本是

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)

当我运行gulp服务时,我收到错误

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

我正在使用此link

运行npm install bufferutil

时出现此错误
{{1}}

请帮我解决这些问题,因为我已经为我的项目编写了代码而无法运行输出。

1 个答案:

答案 0 :(得分:1)

尝试删除您的node_modules并执行全新的npm安装。

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