在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ node.js 安裝好之后,運行npm -v 時出現(xiàn)錯誤

node.js 安裝好之后,運行npm -v 時出現(xiàn)錯誤

node.js安裝好之后,在dos命令下輸入node -v正常;

clipboard.png

但是輸入nmp -v時就出現(xiàn)錯誤了

clipboard.png

下面是錯誤日志:(npm-debug.log)
    0 info it worked if it ends with ok
    1 verbose cli [ 'D:\\Program Files\\nodejs\\node.exe',
    1 verbose cli   'D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
    1 verbose cli   'install',
    1 verbose cli   '-g',
    1 verbose cli   'cnpm',
    1 verbose cli   '–registry=https://registry.npm.taobao.org' ]
    2 info using npm@2.15.1
    3 info using node@v4.4.3
    4 verbose install initial load of C:\Users\Administrator\AppData\Roaming\npm\package.json
    5 verbose readDependencies loading dependencies from C:\Users\Administrator\AppData\Roaming\npm\package.json
    6 silly cache add args [ 'cnpm', null ]
    7 verbose cache add spec cnpm
    8 silly cache add args [ '–registry=https://registry.npm.taobao.org', null ]
    9 verbose cache add spec –registry=https://registry.npm.taobao.org
    10 silly cache add parsed spec Result {
    10 silly cache add   raw: 'cnpm',
    10 silly cache add   scope: null,
    10 silly cache add   name: 'cnpm',
    10 silly cache add   rawSpec: '',
    10 silly cache add   spec: 'latest',
    10 silly cache add   type: 'tag' }
    11 silly addNamed cnpm@latest
    12 verbose addNamed "latest" is being treated as a dist-tag for cnpm
    13 info addNameTag [ 'cnpm', 'latest' ]
    14 silly mapToRegistry name cnpm
    15 silly mapToRegistry using default registry
    16 silly mapToRegistry registry https://registry.npmjs.org/
    17 silly mapToRegistry data Result {
    17 silly mapToRegistry   raw: 'cnpm',
    17 silly mapToRegistry   scope: null,
    17 silly mapToRegistry   name: 'cnpm',
    17 silly mapToRegistry   rawSpec: '',
    17 silly mapToRegistry   spec: 'latest',
    17 silly mapToRegistry   type: 'tag' }
    18 silly mapToRegistry uri https://registry.npmjs.org/cnpm
    19 verbose addNameTag registry:https://registry.npmjs.org/cnpm not in flight; fetching
    20 silly cache add parsed spec Result {
    20 silly cache add   raw: '–registry=https://registry.npm.taobao.org',
    20 silly cache add   scope: null,
    20 silly cache add   name: null,
    20 silly cache add   rawSpec: '–registry=https://registry.npm.taobao.org',
    20 silly cache add   spec: 'D:\\–registry=https:\\registry.npm.taobao.org',
    20 silly cache add   type: 'local' }
    21 error addLocal Could not install D:\–registry=https:\registry.npm.taobao.org
    22 verbose request uri https://registry.npmjs.org/cnpm
    23 verbose request no auth needed
    24 info attempt registry request try #1 at 09:57:51
    25 verbose request id baf8c862cfcdd3ef
    26 verbose etag W/"59fa7e79-28fb1"
    27 verbose lastModified Thu, 02 Nov 2017 02:10:01 GMT
    28 http request GET https://registry.npmjs.org/cnpm
    29 http 304 https://registry.npmjs.org/cnpm
    30 verbose headers { date: 'Tue, 14 Nov 2017 01:53:46 GMT',
    30 verbose headers   via: '1.1 varnish',
    30 verbose headers   'cache-control': 'max-age=300',
    30 verbose headers   etag: 'W/"59fa7e79-28fb1"',
    30 verbose headers   age: '175',
    30 verbose headers   connection: 'keep-alive',
    30 verbose headers   'x-served-by': 'cache-nrt6124-NRT',
    30 verbose headers   'x-cache': 'HIT',
    30 verbose headers   'x-cache-hits': '1',
    30 verbose headers   'x-timer': 'S1510624427.596870,VS0,VE0',
    30 verbose headers   vary: 'Accept-Encoding, Accept' }
    31 silly get cb [ 304,
    31 silly get   { date: 'Tue, 14 Nov 2017 01:53:46 GMT',
    31 silly get     via: '1.1 varnish',
    31 silly get     'cache-control': 'max-age=300',
    31 silly get     etag: 'W/"59fa7e79-28fb1"',
    31 silly get     age: '175',
    31 silly get     connection: 'keep-alive',
    31 silly get     'x-served-by': 'cache-nrt6124-NRT',
    31 silly get     'x-cache': 'HIT',
    31 silly get     'x-cache-hits': '1',
    31 silly get     'x-timer': 'S1510624427.596870,VS0,VE0',
    31 silly get     vary: 'Accept-Encoding, Accept' } ]
    32 verbose etag https://registry.npmjs.org/cnpm from cache
    33 verbose get saving cnpm to C:\Users\Administrator\AppData\Roaming\npm-cache\registry.npmjs.org\cnpm\.cache.json
    34 verbose correctMkdir C:\Users\Administrator\AppData\Roaming\npm-cache correctMkdir not in flight; initializing
    35 silly addNameTag next cb for cnpm with tag latest
    36 silly addNamed cnpm@5.1.1
    37 verbose addNamed "5.1.1" is a plain semver version for cnpm
    38 silly cache afterAdd cnpm@5.1.1
    39 verbose afterAdd C:\Users\Administrator\AppData\Roaming\npm-cache\cnpm\5.1.1\package\package.json not in flight; writing
    40 verbose correctMkdir C:\Users\Administrator\AppData\Roaming\npm-cache correctMkdir not in flight; initializing
    41 verbose afterAdd C:\Users\Administrator\AppData\Roaming\npm-cache\cnpm\5.1.1\package\package.json written
    42 verbose stack Error: ENOENT: no such file or directory, open 'D:\–registry=https:\registry.npm.taobao.org'
    42 verbose stack     at Error (native)
    43 verbose cwd D:\
    44 error Windows_NT 6.1.7601
    45 error argv "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "cnpm" "–registry=https://registry.npm.taobao.org"
    46 error node v4.4.3
    47 error npm  v2.15.1
    48 error path D:\–registry=https:\registry.npm.taobao.org
    49 error code ENOENT
    50 error errno -4058
    51 error syscall open
    52 error enoent ENOENT: no such file or directory, open 'D:\–registry=https:\registry.npm.taobao.org'
    52 error enoent This is most likely not a problem with npm itself
    52 error enoent and is related to npm not being able to find a file.
    53 verbose exit [ -4058, true ]
回答
編輯回答
老梗

1、添加環(huán)境變量,具體自己百度,特別多教程;
2、要不然就先切換到node.js的目錄下,如:“cd C:Program Filesnodejs”,然后再執(zhí)行“node -v”;

2017年11月7日 21:23
編輯回答
萌面人

path 修改路徑的問題,具體度娘上有教程

2018年5月7日 19:32
編輯回答
殘淚

Windows 下安裝的時候,注意勾選 “Add to PATH”,在選擇安裝目錄的那一頁。

另外題主,現(xiàn)在已經(jīng)是 8.9.4 了,你裝 4.x 版本太舊了……

2017年2月7日 03:36
編輯回答
祈歡

一般做法,
1.重啟電腦,特別是設計到環(huán)境變量的
2.使用npm cache clean --force清除緩存
3.使用npm install npm -g,重新安裝npm
4.以上方法都不行,重裝nodejs

2018年7月26日 14:16
編輯回答
爆扎

將npm的路徑添加到環(huán)境變量(如:C:UsersAdministratorAppDataRoamingnpm 具體路徑需要自己電腦確認),然后重啟cmd

2017年3月2日 19:50
編輯回答
野橘

是不是局部安裝了

2017年1月13日 09:50
編輯回答
默念

環(huán)境變量的問題,配置npm的環(huán)境變量

2018年4月28日 17:00