簡體   English   中英

Browserify無法在Node.Js / Mac上正確安裝

[英]Browserify doesn't install correctly on Node.Js / Mac

我正在嘗試在系統上全局安裝Browserify,以便可以從我的js文件運行Node.Js模塊。 當我做

sudo npm install -g browserify

它開始安裝,但是,出現錯誤:

npm http 304 https://registry.npmjs.org/buffer
npm ERR! Error: No compatible version found: browser-resolve@'^1.3.0'
npm ERR! Valid install targets:
npm ERR! ["0.0.0","0.0.1","0.0.2","0.0.3","0.0.4","0.0.5","0.1.0","0.1.1","1.0.0","1.0.1","1.1.0","1.1.1","1.1.2","1.1.3","1.1.4","1.2.0","1.2.1","1.2.2","1.2.3","1.2.4","1.3.0","1.3.1","1.3.2","1.4.0","1.4.1"]
npm ERR!     at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:682:10)
npm ERR!     at /usr/local/lib/node_modules/npm/lib/cache.js:597:10
npm ERR!     at saved (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:138:7)
npm ERR!     at Object.oncomplete (fs.js:297:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Darwin 13.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "browserify"
npm ERR! cwd /Users/deemeetree/Documents/Root/InfraNodus
npm ERR! node -v v0.8.22
npm ERR! npm -v 1.2.14

您知道我還能嘗試什么以及為什么它不起作用嗎?

您正在使用哪個操作系統? 我只是做到了,它運行良好(我正在使用OSX)。

$ npm install -g browserify
/usr/local/bin/browserify -> /usr/local/lib/node_modules/browserify/bin/cmd.js
browserify@6.2.0 /usr/local/lib/node_modules/browserify
├── https-browserify@0.0.0
├── tty-browserify@0.0.0
├── builtins@0.0.7
├── constants-browserify@0.0.1
├── path-browserify@0.0.0
├── process@0.8.0
├── os-browserify@0.1.2
├── isarray@0.0.1
├── inherits@2.0.1
├── commondir@0.0.1
├── string_decoder@0.10.31
├── stream-browserify@1.0.0
├── defined@0.0.0
├── domain-browser@1.1.3
├── shell-quote@0.0.1
├── shallow-copy@0.0.1
├── xtend@3.0.0
├── deep-equal@0.2.1
├── assert@1.1.2
├── querystring-es3@0.2.1
├── punycode@1.2.4
├── url@0.10.1
├── util@0.10.3
├── events@1.0.2
├── timers-browserify@1.1.0 (process@0.5.2)
├── parents@0.0.3 (path-platform@0.0.1)
├── vm-browserify@0.0.4 (indexof@0.0.1)
├── console-browserify@1.1.0 (date-now@0.1.4)
├── readable-stream@1.0.33 (core-util-is@1.0.1)
├── http-browserify@1.7.0 (Base64@0.2.1)
├── subarg@1.0.0 (minimist@1.1.0)
├── deps-sort@1.3.5 (through2@0.5.1, minimist@0.2.0)
├── resolve@0.7.4
├── browser-resolve@1.4.1
├── through2@1.1.1 (xtend@4.0.0, readable-stream@1.1.13)
├── buffer@2.8.1 (ieee754@1.1.4, base64-js@0.0.7, is-array@1.0.1)
├── shasum@1.0.0 (json-stable-stringify@0.0.1)
├── duplexer2@0.0.2 (readable-stream@1.1.13)
├── concat-stream@1.4.6 (typedarray@0.0.6, readable-stream@1.1.13)
├── labeled-stream-splicer@1.0.0 (stream-splicer@1.3.1)
├── JSONStream@0.8.4 (through@2.3.6, jsonparse@0.0.5)
├── syntax-error@1.1.1 (esprima-fb@3001.1.0-dev-harmony-fb)
├── glob@4.0.6 (graceful-fs@3.0.4, once@1.3.1, minimatch@1.0.0)
├── browser-pack@3.2.0 (through2@0.5.1, combine-source-map@0.3.0)
├── umd@2.1.0 (through@2.3.6, rfile@1.0.0, ruglify@1.0.0, uglify-js@2.4.15)
├── browserify-zlib@0.1.4 (pako@0.2.5)
├── crypto-browserify@3.3.0 (ripemd160@0.2.0, pbkdf2-compat@2.0.1, browserify-aes@0.4.0, sha.js@2.2.6)
├── module-deps@3.5.6 (minimist@0.2.0, stream-combiner2@1.0.2, parents@1.0.0, subarg@0.0.1, JSONStream@0.7.4, through2@0.4.2, detective@3.1.0)
└── insert-module-globals@6.1.0 (process@0.6.0, through@2.3.6, JSONStream@0.7.4, lexical-scope@1.1.0)

$ browserify -v
6.2.0

你可以再試一次嗎? 可能是暫時的問題(似乎是舊版本的瀏覽器解決問題)。 但是,如果您找到類似的內容,則可能要在其存儲庫中將其報告為問題: https : //github.com/substack/node-browserify

希望這可以幫助!

問題是我正在運行Node 0.8和不支持^的舊版本npm。

我在Mac上全局重新安裝了node和npm,現在工作正常。

這是有關如何在Mac上安裝節點和npm的非常好的建議: https : //gist.github.com/DanHerbert/9520689

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM