0

我正在尝试按照本指南安装量角器:

    https://angular.github.io/protractor/#/

在外壳中的 ubuntu 上,我输入:sudo npm install -g protractor

有一大堆信息告诉我们某些特定软件包的安装是否顺利。在这里,我在某些软件包上遇到了一些错误。我添加了错误,并没有添加运行良好的错误。任何人都知道如何解决这个问题。

感谢您的任何帮助,您可以提供

   /bin/sh: 1: node: not found
    gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp
    gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:431:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.13.0-53-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/node_modules/ws/node_modules/bufferutil
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok 
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 WARN optional dep failed, continuing bufferutil@1.1.0
/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:431:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.13.0-53-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/node_modules/ws/node_modules/utf-8-validate
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok 
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 WARN optional dep failed, continuing utf-8-validate@1.1.0
/usr/local/bin/webdriver-manager -> /usr/local/lib/node_modules/protractor/bin/webdriver-manager
/usr/local/bin/protractor -> /usr/local/lib/node_modules/protractor/bin/protractor
protractor@2.1.0 /usr/local/lib/node_modules/protractor
├── jasminewd@1.1.0
├── jasminewd2@0.0.5
├── saucelabs@0.1.1
├── html-entities@1.1.2
├── q@1.0.0
├── minijasminenode@1.1.1
├── adm-zip@0.4.4
├── optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10)
├── glob@3.2.11 (inherits@2.0.1, minimatch@0.3.0)
├── jasmine@2.3.1 (exit@0.1.2, jasmine-core@2.3.4)
├── accessibility-developer-tools@2.6.0
├── lodash@2.4.2
├── source-map-support@0.2.10 (source-map@0.1.32)
├── request@2.36.0 (aws-sign2@0.5.0, forever-agent@0.5.2, qs@0.6.6, oauth-sign@0.3.0, tunnel-agent@0.4.0, json-stringify-safe@5.0.1, mime@1.2.11, node-uuid@1.4.3, http-signature@0.10.1, form-data@0.1.4, tough-cookie@2.0.0, hawk@1.0.0)
└── selenium-webdriver@2.45.1 (tmp@0.0.24, rimraf@2.4.0, xml2js@0.4.4, ws@0.7.2)
4

1 回答 1

1

在 Ubuntu 上,Node 命令实际上是“nodejs”,而 Protractor 安装程序正在寻找“node”。

尝试运行这个:

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

然后重新运行量角器安装

sudo npm install -g protractor
于 2015-06-17T19:21:01.313 回答