【发布时间】:2015-02-26 11:40:20
【问题描述】:
好吧,这很臭,这是独家新闻:
我正在帮助一位朋友使用 MEAN 堆栈(mongodb、express、angular 和 nodejs)进行网站项目,我正在运行 Ubuntu 14.04。我对 Linux 相当了解,而且我是一位经验丰富的 Web 开发人员,但我的大部分经验是使用 LAMP 堆栈。直到今天晚上,我一直在处理这个 MEAN 堆栈项目。我的朋友今晚重新开始开发,我通过运行 npm update 帮助他们在 Mac 上刷新了他们的节点环境(他们主要做前端 HTML/CSS,我做全栈),并且项目在他们的 comp 上运行良好。考虑到我可以轻松地刷新我的节点环境以更新我尝试了同样的事情:
我尝试更新我的节点和 npm 环境,因为我这样做已经有几个月了(我知道这很糟糕,我搞砸了,我承认),我想我使用的是 Node.js v 0.3。 2.something,在这场混乱发生之前没想到要检查版本号。但是现在我得到了疯狂的随机错误集,未满足的依赖关系,我无法通过使用 npm install 来获取它们来解决未满足的依赖关系,而且我无法启动开发服务器,我已经尝试删除节点并且 npm 和重新安装(现在运行 nodejs 0.10.25)已经运行 apt-get update、apt-get install nodejs、apt-get install nodejs-dev、npm update、npm install 等,但无济于事。
我已经超越了卡住和沮丧,请帮助!这是我得到的一些错误/缺少依赖项的示例:
module.js:340
throw err;
^
Error: Cannot find module './helpers'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous>
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
npm ERR! weird error 8
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! not ok code 0
当我尝试运行 sudo grunt 时,我得到了这个:
Loading "jshint.js" tasks...ERROR
>> Error: Cannot find module './name-stack.js'
Loading "grunt-karma.js" tasks...ERROR
>> Error: Cannot find module 'depd'
Warning: Task "jshint" not found. Used --force, continuing.
Running "concurrent:default" (concurrent) task
Loading "jshint.js" tasks...ERROR
>> Error: Cannot find module './name-stack.js'
Loading "jshint.js" tasks...ERROR
>> Error: Cannot find module './name-stack.js'
Loading "grunt-karma.js" tasks...ERROR
Loading "grunt-karma.js" tasks...ERROR
>> Error: Cannot find module 'depd'
>> Error: Cannot find module 'depd'
[Error: /home/user/Projects/detrashed/node_modules/mongoose/node_modules/mongodb/node_modules/bson/build/Release/bson.node: invalid ELF header]
js-bson: Failed to load c++ bson extension, using pure JS version
[Error: /home/user/Projects/detrashed/node_modules/connect- mongo/node_modules/mongodb/node_modules/bson/build/Release/bson.node: invalid ELF header]
js-bson: Failed to load c++ bson extension, using pure JS version
module.js:340
throw err;
^
Error: Cannot find module './collection/batch/unordered'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/user/Projects/detrashed/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/collection.js:21:17)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
好尴尬。任何有关如何取消我的 nodejs 环境的帮助或见解都将非常有帮助,因为我要拔掉头发了。提前致谢!
【问题讨论】:
-
你能链接你的 package.json 吗?
标签: node.js gruntjs npm ubuntu-14.04 mean-stack