简体   繁体   English

无法在Ubuntu 64位上安装js-yaml NPM软件包相关性

[英]Trouble installing js-yaml NPM package dependancies on Ubuntu 64 bits

I am trying to get my own project written on OSX to build on Ubuntu. 我试图在OSX编写自己的项目以在Ubuntu 构建。 It uses several npm packages to build itself. 它使用几个npm软件包进行构建。 A few of them depend on the npm package js-yaml, which in it's turn depends on a package called 'esprima'. 其中一些依赖于npm软件包js-yaml,而js-yaml则依赖于名为“ esprima”的软件包。 A fresh Ubuntu 14.04 installation gives me the error that this package can not be found: 全新的Ubuntu 14.04安装让我发现找不到此软件包的错误:

module.js:340 throw err; module.js:340 throw err; ^ Error: Cannot find module 'esprima' 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. ^错误:在Module.require(module.js:364 :)的Function.Module._load(module.js:280:25)的Function.Module._resolveFilename(module.js:338:15)上找不到模块'esprima': 17)在对象的require(module.js:380:17)。 (/home/michahell/Documents/projects/pinbored-webkit/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/function.js:4:15) 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! (/home/michahell/Documents/projects/pinbored-webkit/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/function.js:4:15)在Module._compile(module.js :456:26)在Object.Module._extensions..js(module.js:474:10)在Module.load(module.js:356:32)在Function.Module._load(module.js:312:12) )在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 奇怪的错误8 npm WARN此失败可能是由于使用旧式二进制“节点” npm WARN引起的。有关更多说明,请阅读/usr/share/doc/nodejs/README.Debian。

The output tells me that it might have something to do with the legacy binary node, but i should have solved this problem by symlinking node to point to nodejs, using this SO post: nodejs vs node on ubuntu 12.04 输出告诉我,它可能与旧式二进制节点有关,但是我应该使用以下SO帖子通过符号链接节点以指向nodejs来解决此问题: ubuntu 12.04上的nodejs vs node

So, what is causing npm / node to not be able to find or install this package? 那么,是什么原因导致npm / node无法找到或安装此软件包?

So i have apparently solved this by manually installing the missing node module: 所以我显然已经通过手动安装缺少的节点模块解决了这个问题:

npm install esprima

Apparently, the npm module requiring this esprima module could just find it if it was 'locally' npm installed. 显然,如果需要“ esprima”模块的npm模块是“本地”安装的npm,则只能找到它。 If this is intended / deterministic behaviour, that's nice to know :) 如果这是预期的/确定性的行为,很高兴知道:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM