- npm 是什么?
- 如何安装 npm 并管理 npm 版本
- How to Prevent Permissions Errors
- 如何安装本地包
- Working with package.json
- 如何更新本地安装的包
- 如何卸载本地安装的包
- 如何安装全局包
- 如何更新全局安装的包
- 如何卸载全局安装的包
- 如何创建 Node.js 模块
- How to Publish & Update a Package
- 如何使用语义化版本
- How to Work with Scoped Packages
- How to Label Packages with Dist-tags
- How to Use Two-Factor Authentication
- How to Work with Security Tokens
- How to Change Profile Settings from the CLI
- Understanding Packages and Modules
- npm-access
- npm-adduser
- npm-audit
- npm-bin
- npm-bugs
- npm-build
- npm-bundle
- npm-cache
- npm-ci
- npm-completion
- npm-config
- npm-dedupe
- npm-deprecate
- npm-dist-tag
- npm-docs
- npm-doctor
- npm-edit
- npm-explore
- npm-help
- npm-help-search
- npm-hook
- npm-init
- npm-install
- npm install-ci-test -- Install a project with a clean slate and run tests
- npm install-test -- 安装依赖包并运行测试
- npm-link
- npm-logout
- npm-ls
- npm
- npm-org
- npm-outdated
- npm-owner
- npm-pack
- npm-ping
- npm-prefix
- npm-profile
- npm-prune
- npm-publish
- npm-rebuild
- npm-repo
- npm-restart
- npm-root
- npm-run-script
- npm-search
- npm-shrinkwrap
- npm-star
- npm-stars
- npm-start
- npm-stop
- npm-team
- npm-test
- npm-token
- npm-uninstall
- npm-unpublish
- npm-update
- npm-version
- npm-view
- npm-whoami
- npm-coding-style
- npm-config
- npm-developers
- npm-disputes
- npm-orgs
- npm-registry
- npm-removal
- npm-scope
- npm-scripts
- semver
- npm-folders
- npmrc
- package-lock.json
- npm-package-locks
- package.json
- npm-shrinkwrap.json
- 尝试 node 的最新稳定版本
- Try the latest stable version of npm
- 如果 npm 损坏了
- Try clearing the npm cache
- Common Errors
Common Errors
No compatible version found
You have an outdated npm. Permission Error
npm ERR! code EPERM
npm ERR! code EACCES
- Fix the permissions of your cache with
sudo chown -R $(whoami) "$HOME/.npm"
. - Try again with
sudo
. e.g.sudo npm install express -g
. (You'll probably need to fix cache permissions afterwards, as above). - Travis projects using 0.8 can't upgrade to npm 2
In your
.travis.yml
replace this:before_install:- npm install -g npm@latestwith this:
before_install:- '[ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g npm@1.4.28'- npm install -g npm@latestThis suggestion is based on
Error: ENOENT, stat 'C:\Users\<user>\AppData\Roaming\npm'
on Windows 7This is a consequence of No space
npm ERR! Error: ENOSPC, write
You are trying to install on a drive that either has no space, or has no permission to write.
- Free some disk space or
- Set the tmp folder somewhere with more space:
npm config set tmp /path/to/big/drive/tmp
or - Build Node yourself and install it somewhere writable with lots of space.
No git
npm ERR! not found: git ENOGIT
You need to running a Vagrant box on Windows fails due to path length issues
npm only uses
git:
andssh+git:
URLs for GitHub repos, breaking proxiesSSL Error
npm ERR! Error: 7684:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:787:
You are trying to talk SSL to an unencrypted endpoint. More often than not, this is due to a SSL-intercepting proxy
Unsolved. See Not found / Server error
npm http 404 https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.7.0.tgz npm ERR! fetch failed https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.7.0.tgz npm ERR! Error: 404 Not Found
npm http 500 https://registry.npmjs.org/phonegap
- It's most likely a temporary npm registry glitch. Check Invalid JSON
Error: Invalid JSON
npm ERR! SyntaxError: Unexpected token <
npm ERR! registry error parsing json
- Possible temporary npm registry glitch, or corrupted local server cache. Run
npm cache clean
and/or try again later. - This can be caused by corporate proxies that give HTML responses to
package.json
requests. Check npm's proxy ManyENOENT
/ENOTEMPTY
errors in outputnpm is written to use resources efficiently on install, and part of this is that it tries to do as many things concurrently as is practical. Sometimes this results in race conditions and other synchronization issues. As of npm 2.0.0, a very large number of these issues were addressed. If you see
ENOENT lstat
,ENOENT chmod
,ENOTEMPTY unlink
, or something similar in your log output, try updating npm to the latest version. If the problem persists, look atcb() never called!
when using shrinkwrapped dependenciesTake a look at
npm login
errorsSometimes
npm login
fails for no obvious reason. The first thing to do is to log in atnpm
hangs on Windows ataddRemoteTarball
Check if you have two temp directories set in your
.npmrc
:> npm config ls -l
Look for lines defining the
tmp
config variable. If you find more than one, remove all but one of them.See Other
- Some strange issues can be resolved by simply running
npm cache clean
and trying again. - If you are having trouble with
npm install
, use the-verbose
option to have more details.
- Some strange issues can be resolved by simply running
- Possible temporary npm registry glitch, or corrupted local server cache. Run
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论