无法运行 sudo npm install -g typescript

Posted

技术标签:

【中文标题】无法运行 sudo npm install -g typescript【英文标题】:Cant run sudo npm install -g typescript 【发布时间】:2017-02-14 09:35:54 【问题描述】:

遇到难以理解的问题。达尔文16.1.0有问题吗?不确定这些 web pack 是什么或如何验证它们。

ian$ sudo npm install -g typescript
/usr/local/bin/tsc -> /usr/local/lib/node_modules/typescript/bin/tsc
/usr/local/bin/tsserver -> /usr/local/lib/node_modules/typescript/bin/tsserver
npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "typescript"
npm ERR! node v4.5.0
npm ERR! npm  v2.15.9
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package webpack@2.1.0-beta.22 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer html-webpack-plugin@2.22.0 wants webpack@*
npm ERR! peerinvalid Peer karma-webpack@1.8.0 wants webpack@^1.1.0 || ^2 || ^2.1.0-beta
npm ERR! peerinvalid Peer sass-loader@3.2.3 wants webpack@^1.12.6 || ^2.1.0-beta
npm ERR! peerinvalid Peer string-replace-loader@1.0.5 wants webpack@1 || 2 || ^2.0.0-beta || ^2.1.0-beta
npm ERR! peerinvalid Peer webpack-dev-server@2.1.0-beta.3 wants webpack@^2.1.0-beta

这里是调试日志,或许对你有帮助:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   'typescript' ]
2 info using npm@2.15.9
3 info using node@v4.5.0
4 verbose install initial load of /usr/local/lib/package.json
5 verbose readDependencies loading dependencies from /usr/local/lib/package.json
6 silly cache add args [ 'typescript', null ]
7 verbose cache add spec typescript
8 silly cache add parsed spec Result 
8 silly cache add   raw: 'typescript',
8 silly cache add   scope: null,
8 silly cache add   name: 'typescript',
8 silly cache add   rawSpec: '',
8 silly cache add   spec: 'latest',
8 silly cache add   type: 'tag' 
9 silly addNamed typescript@latest
10 verbose addNamed "latest" is being treated as a dist-tag for typescript
11 info addNameTag [ 'typescript', 'latest' ]
12 silly mapToRegistry name typescript
13 silly mapToRegistry using default registry
14 silly mapToRegistry registry https://registry.npmjs.org/
15 silly mapToRegistry data Result 
15 silly mapToRegistry   raw: 'typescript',
15 silly mapToRegistry   scope: null,
15 silly mapToRegistry   name: 'typescript',
15 silly mapToRegistry   rawSpec: '',
15 silly mapToRegistry   spec: 'latest',
15 silly mapToRegistry   type: 'tag' 
16 silly mapToRegistry uri https://registry.npmjs.org/typescript
17 verbose addNameTag registry:https://registry.npmjs.org/typescript not in flight; fetching
18 verbose get https://registry.npmjs.org/typescript not expired, no request
19 silly addNameTag next cb for typescript with tag latest
20 silly addNamed typescript@2.0.3
21 verbose addNamed "2.0.3" is a plain semver version for typescript
22 silly cache afterAdd typescript@2.0.3
23 verbose afterAdd /Users/iancray/.npm/typescript/2.0.3/package/package.json not in flight; writing
24 verbose correctMkdir /Users/iancray/.npm correctMkdir not in flight; initializing
25 verbose afterAdd /Users/iancray/.npm/typescript/2.0.3/package/package.json written
26 silly install resolved [  name: 'typescript',
26 silly install resolved     author:  name: 'Microsoft Corp.' ,
26 silly install resolved     homepage: 'http://typescriptlang.org/',
26 silly install resolved     version: '2.0.3',
26 silly install resolved     license: 'Apache-2.0',
26 silly install resolved     description: 'TypeScript is a language for application scale javascript development',
26 silly install resolved     keywords: [ 'TypeScript', 'Microsoft', 'compiler', 'language', 'javascript' ],
26 silly install resolved     bugs:  url: 'https://github.com/Microsoft/TypeScript/issues' ,
26 silly install resolved     repository:
26 silly install resolved       type: 'git',
26 silly install resolved        url: 'git+https://github.com/Microsoft/TypeScript.git' ,
26 silly install resolved     main: './lib/typescript.js',
26 silly install resolved     typings: './lib/typescript.d.ts',
26 silly install resolved     bin:  tsc: './bin/tsc', tsserver: './bin/tsserver' ,
26 silly install resolved     engines:  node: '>=0.8.0' ,
26 silly install resolved     devDependencies:
26 silly install resolved       '@types/browserify': 'latest',
26 silly install resolved        '@types/chai': 'latest',
26 silly install resolved        '@types/convert-source-map': 'latest',
26 silly install resolved        '@types/del': 'latest',
26 silly install resolved        '@types/glob': 'latest',
26 silly install resolved        '@types/gulp': 'latest',
26 silly install resolved        '@types/gulp-concat': 'latest',
26 silly install resolved        '@types/gulp-help': 'latest',
26 silly install resolved        '@types/gulp-newer': 'latest',
26 silly install resolved        '@types/gulp-sourcemaps': 'latest',
26 silly install resolved        '@types/gulp-typescript': 'latest',
26 silly install resolved        '@types/merge2': 'latest',
26 silly install resolved        '@types/minimatch': 'latest',
26 silly install resolved        '@types/minimist': 'latest',
26 silly install resolved        '@types/mkdirp': 'latest',
26 silly install resolved        '@types/mocha': 'latest',
26 silly install resolved        '@types/node': 'latest',
26 silly install resolved        '@types/q': 'latest',
26 silly install resolved        '@types/run-sequence': 'latest',
26 silly install resolved        '@types/through2': 'latest',
26 silly install resolved        browserify: 'latest',
26 silly install resolved        chai: 'latest',
26 silly install resolved        'convert-source-map': 'latest',
26 silly install resolved        del: 'latest',
26 silly install resolved        gulp: 'latest',
26 silly install resolved        'gulp-clone': 'latest',
26 silly install resolved        'gulp-concat': 'latest',
26 silly install resolved        'gulp-help': 'latest',
26 silly install resolved        'gulp-insert': 'latest',
26 silly install resolved        'gulp-newer': 'latest',
26 silly install resolved        'gulp-sourcemaps': 'latest',
26 silly install resolved        'gulp-typescript': 'latest',
26 silly install resolved        'into-stream': 'latest',
26 silly install resolved        istanbul: 'latest',
26 silly install resolved        jake: 'latest',
26 silly install resolved        merge2: 'latest',
26 silly install resolved        minimist: 'latest',
26 silly install resolved        mkdirp: 'latest',
26 silly install resolved        mocha: 'latest',
26 silly install resolved        'mocha-fivemat-progress-reporter': 'latest',
26 silly install resolved        q: 'latest',
26 silly install resolved        'run-sequence': 'latest',
26 silly install resolved        sorcery: 'latest',
26 silly install resolved        through2: 'latest',
26 silly install resolved        'travis-fold': 'latest',
26 silly install resolved        'ts-node': 'latest',
26 silly install resolved        tslint: '3.15.1',
26 silly install resolved        typescript: '2.0.*' ,
26 silly install resolved     scripts:
26 silly install resolved       pretest: 'jake tests',
26 silly install resolved        test: 'jake runtests-parallel',
26 silly install resolved        build: 'npm run build:compiler && npm run build:tests',
26 silly install resolved        'build:compiler': 'jake local',
26 silly install resolved        'build:tests': 'jake tests',
26 silly install resolved        start: 'node lib/tsc',
26 silly install resolved        clean: 'jake clean',
26 silly install resolved        gulp: 'gulp',
26 silly install resolved        jake: 'jake',
26 silly install resolved        lint: 'jake lint',
26 silly install resolved        'setup-hooks': 'node scripts/link-hooks.js' ,
26 silly install resolved     browser:  buffer: false, fs: false, os: false, path: false ,
26 silly install resolved     gitHead: '4f65a2885e000c27e5f079171d440797d7307b97',
26 silly install resolved     _id: 'typescript@2.0.3',
26 silly install resolved     _shasum: '33dec9eae86b8eee327dd419ca050c853cabd514',
26 silly install resolved     _from: 'typescript@latest',
26 silly install resolved     _npmVersion: '3.8.6',
26 silly install resolved     _nodeVersion: '5.11.1',
26 silly install resolved     _npmUser:  name: 'typescript', email: 'typescript@microsoft.com' ,
26 silly install resolved     dist:
26 silly install resolved       shasum: '33dec9eae86b8eee327dd419ca050c853cabd514',
26 silly install resolved        tarball: 'https://registry.npmjs.org/typescript/-/typescript-2.0.3.tgz' ,
26 silly install resolved     maintainers: [ [Object] ],
26 silly install resolved     _npmOperationalInternal:
26 silly install resolved       host: 'packages-12-west.internal.npmjs.com',
26 silly install resolved        tmp: 'tmp/typescript-2.0.3.tgz_1474560003144_0.4724818258546293' ,
26 silly install resolved     directories: ,
26 silly install resolved     _resolved: 'https://registry.npmjs.org/typescript/-/typescript-2.0.3.tgz',
26 silly install resolved     readme: 'ERROR: No README data found!'  ]
27 info install typescript@2.0.3 into /usr/local/lib
28 info installOne typescript@2.0.3
29 verbose installOne of typescript to /usr/local/lib not in flight; installing
30 verbose correctMkdir /Users/iancray/.npm/_locks correctMkdir not in flight; initializing
31 verbose lock using /Users/iancray/.npm/_locks/typescript-5355178f5d1a073f.lock for /usr/local/lib/node_modules/typescript
32 silly install write writing typescript 2.0.3 to /usr/local/lib/node_modules/typescript
33 verbose unbuild lib/node_modules/typescript
34 info preuninstall typescript@2.0.3
35 info uninstall typescript@2.0.3
36 verbose unbuild rmStuff typescript@2.0.3 from /usr/local/lib/node_modules
37 silly gentlyRm /usr/local/bin/tsc is being gently removed
38 silly gentlyRm verifying /usr/local is an npm working directory
39 silly gentlyRm /usr/local/bin/tsserver is being gently removed
40 silly gentlyRm verifying /usr/local is an npm working directory
41 silly gentlyRm containing path /usr/local is under npm's control, in /usr/local
42 silly gentlyRm deletion target /usr/local/bin/tsc is under /usr/local
43 verbose gentlyRm vacuuming from /usr/local/bin/tsc up to /usr/local
44 silly gentlyRm containing path /usr/local is under npm's control, in /usr/local
45 silly gentlyRm deletion target /usr/local/bin/tsserver is under /usr/local
46 verbose gentlyRm vacuuming from /usr/local/bin/tsserver up to /usr/local
47 silly vacuum-fs removing /usr/local/bin/tsc
48 silly vacuum-fs removing /usr/local/bin/tsserver
49 silly vacuum-fs quitting because other entries in /usr/local/bin
50 silly vacuum-fs quitting because other entries in /usr/local/bin
51 info postuninstall typescript@2.0.3
52 silly gentlyRm /usr/local/lib/node_modules/typescript is being purged from base /usr/local
53 verbose gentlyRm don't care about contents; nuking /usr/local/lib/node_modules/typescript
54 silly vacuum-fs purging /usr/local/lib/node_modules/typescript
55 silly vacuum-fs quitting because other entries in /usr/local/lib/node_modules
56 verbose tar unpack /Users/iancray/.npm/typescript/2.0.3/package.tgz
57 verbose tar unpacking to /usr/local/lib/node_modules/typescript
58 silly gentlyRm /usr/local/lib/node_modules/typescript is being purged
59 verbose gentlyRm don't care about contents; nuking /usr/local/lib/node_modules/typescript
60 silly gunzTarPerm modes [ '755', '644' ]
61 silly gunzTarPerm extractEntry package.json
62 silly gunzTarPerm modified mode [ 'package.json', 438, 420 ]
63 silly gunzTarPerm extractEntry .npmignore
64 silly gunzTarPerm modified mode [ '.npmignore', 438, 420 ]
65 silly gunzTarPerm extractEntry README.md
66 silly gunzTarPerm modified mode [ 'README.md', 438, 420 ]
67 silly gunzTarPerm extractEntry ThirdPartyNoticeText.txt
68 silly gunzTarPerm modified mode [ 'ThirdPartyNoticeText.txt', 438, 420 ]
69 silly gunzTarPerm extractEntry AUTHORS.md
70 silly gunzTarPerm modified mode [ 'AUTHORS.md', 438, 420 ]
71 silly gunzTarPerm extractEntry CONTRIBUTING.md
72 silly gunzTarPerm modified mode [ 'CONTRIBUTING.md', 438, 420 ]
73 silly gunzTarPerm extractEntry CopyrightNotice.txt
74 silly gunzTarPerm modified mode [ 'CopyrightNotice.txt', 438, 420 ]
75 silly gunzTarPerm extractEntry Gulpfile.ts
76 silly gunzTarPerm modified mode [ 'Gulpfile.ts', 438, 420 ]
77 silly gunzTarPerm extractEntry LICENSE.txt
78 silly gunzTarPerm modified mode [ 'LICENSE.txt', 438, 420 ]
79 silly gunzTarPerm extractEntry .mailmap
80 silly gunzTarPerm modified mode [ '.mailmap', 438, 420 ]
81 silly gunzTarPerm extractEntry bin/tsc
82 silly gunzTarPerm modified mode [ 'bin/tsc', 438, 420 ]
83 silly gunzTarPerm extractEntry bin/tsserver
84 silly gunzTarPerm modified mode [ 'bin/tsserver', 438, 420 ]
85 silly gunzTarPerm extractEntry lib/README.md
86 silly gunzTarPerm modified mode [ 'lib/README.md', 438, 420 ]
87 silly gunzTarPerm extractEntry lib/typescript.js
88 silly gunzTarPerm modified mode [ 'lib/typescript.js', 438, 420 ]
89 silly gunzTarPerm extractEntry lib/tsserverlibrary.js
90 silly gunzTarPerm modified mode [ 'lib/tsserverlibrary.js', 438, 420 ]
91 silly gunzTarPerm extractEntry lib/tsserver.js
92 silly gunzTarPerm modified mode [ 'lib/tsserver.js', 438, 420 ]
93 silly gunzTarPerm extractEntry lib/tsc.js
94 silly gunzTarPerm modified mode [ 'lib/tsc.js', 438, 420 ]
95 silly gunzTarPerm extractEntry lib/typescriptServices.js
96 silly gunzTarPerm modified mode [ 'lib/typescriptServices.js', 438, 420 ]
97 silly gunzTarPerm extractEntry lib/lib.es2017.sharedmemory.d.ts
98 silly gunzTarPerm modified mode [ 'lib/lib.es2017.sharedmemory.d.ts', 438, 420 ]
99 silly gunzTarPerm extractEntry lib/lib.es2015.d.ts
100 silly gunzTarPerm modified mode [ 'lib/lib.es2015.d.ts', 438, 420 ]
101 silly gunzTarPerm extractEntry lib/lib.es2015.iterable.d.ts
102 silly gunzTarPerm modified mode [ 'lib/lib.es2015.iterable.d.ts', 438, 420 ]
103 silly gunzTarPerm extractEntry lib/lib.es2015.promise.d.ts
104 silly gunzTarPerm modified mode [ 'lib/lib.es2015.promise.d.ts', 438, 420 ]
105 silly gunzTarPerm extractEntry lib/lib.es2015.proxy.d.ts
106 silly gunzTarPerm modified mode [ 'lib/lib.es2015.proxy.d.ts', 438, 420 ]
107 silly gunzTarPerm extractEntry lib/lib.es2015.reflect.d.ts
108 silly gunzTarPerm modified mode [ 'lib/lib.es2015.reflect.d.ts', 438, 420 ]
109 silly gunzTarPerm extractEntry lib/lib.es2015.symbol.d.ts
110 silly gunzTarPerm modified mode [ 'lib/lib.es2015.symbol.d.ts', 438, 420 ]
111 silly gunzTarPerm extractEntry lib/lib.es2015.symbol.wellknown.d.ts
112 silly gunzTarPerm modified mode [ 'lib/lib.es2015.symbol.wellknown.d.ts', 438, 420 ]
113 silly gunzTarPerm extractEntry lib/lib.es2016.array.include.d.ts
114 silly gunzTarPerm modified mode [ 'lib/lib.es2016.array.include.d.ts', 438, 420 ]
115 silly gunzTarPerm extractEntry lib/lib.d.ts
116 silly gunzTarPerm modified mode [ 'lib/lib.d.ts', 438, 420 ]
117 silly gunzTarPerm extractEntry lib/lib.es2017.d.ts
118 silly gunzTarPerm modified mode [ 'lib/lib.es2017.d.ts', 438, 420 ]
119 silly gunzTarPerm extractEntry lib/lib.es2017.object.d.ts
120 silly gunzTarPerm modified mode [ 'lib/lib.es2017.object.d.ts', 438, 420 ]
121 silly gunzTarPerm extractEntry lib/lib.es2015.generator.d.ts
122 silly gunzTarPerm modified mode [ 'lib/lib.es2015.generator.d.ts', 438, 420 ]
123 silly gunzTarPerm extractEntry lib/lib.es5.d.ts
124 silly gunzTarPerm modified mode [ 'lib/lib.es5.d.ts', 438, 420 ]
125 silly gunzTarPerm extractEntry lib/lib.es6.d.ts
126 silly gunzTarPerm modified mode [ 'lib/lib.es6.d.ts', 438, 420 ]
127 silly gunzTarPerm extractEntry lib/lib.scripthost.d.ts
128 silly gunzTarPerm modified mode [ 'lib/lib.scripthost.d.ts', 438, 420 ]
129 silly gunzTarPerm extractEntry lib/lib.webworker.d.ts
130 silly gunzTarPerm modified mode [ 'lib/lib.webworker.d.ts', 438, 420 ]
131 silly gunzTarPerm extractEntry lib/lib.es2015.core.d.ts
132 silly gunzTarPerm modified mode [ 'lib/lib.es2015.core.d.ts', 438, 420 ]
133 silly gunzTarPerm extractEntry lib/lib.es2015.collection.d.ts
134 silly gunzTarPerm modified mode [ 'lib/lib.es2015.collection.d.ts', 438, 420 ]
135 silly gunzTarPerm extractEntry lib/tsserverlibrary.d.ts
136 silly gunzTarPerm modified mode [ 'lib/tsserverlibrary.d.ts', 438, 420 ]
137 silly gunzTarPerm extractEntry lib/lib.dom.iterable.d.ts
138 silly gunzTarPerm modified mode [ 'lib/lib.dom.iterable.d.ts', 438, 420 ]
139 silly gunzTarPerm extractEntry lib/typescript.d.ts
140 silly gunzTarPerm modified mode [ 'lib/typescript.d.ts', 438, 420 ]
141 silly gunzTarPerm extractEntry lib/lib.dom.d.ts
142 silly gunzTarPerm modified mode [ 'lib/lib.dom.d.ts', 438, 420 ]
143 silly gunzTarPerm extractEntry lib/typescriptServices.d.ts
144 silly gunzTarPerm modified mode [ 'lib/typescriptServices.d.ts', 438, 420 ]
145 silly gunzTarPerm extractEntry lib/lib.es2016.d.ts
146 silly gunzTarPerm modified mode [ 'lib/lib.es2016.d.ts', 438, 420 ]
147 silly gunzTarPerm extractEntry test.config
148 silly gunzTarPerm modified mode [ 'test.config', 438, 420 ]
149 verbose write writing to /usr/local/lib/node_modules/typescript/package.json
150 info preinstall typescript@2.0.3
151 verbose readDependencies loading dependencies from /usr/local/lib/node_modules/typescript/package.json
152 verbose readDependencies loading dependencies from /usr/local/lib/node_modules/typescript/package.json
153 silly install resolved []
154 verbose about to build /usr/local/lib/node_modules/typescript
155 info build /usr/local/lib/node_modules/typescript
156 info linkStuff typescript@2.0.3
157 silly linkStuff typescript@2.0.3 has /usr/local/lib/node_modules as its parent node_modules
158 silly linkStuff typescript@2.0.3 is part of a global install
159 silly linkStuff typescript@2.0.3 is installed into a global node_modules
160 silly linkStuff typescript@2.0.3 is installed into the top-level global node_modules
161 verbose linkBins typescript@2.0.3
162 verbose link bins [  tsc: './bin/tsc', tsserver: './bin/tsserver' ,
162 verbose link bins   '/usr/local/bin',
162 verbose link bins   true ]
163 verbose linkMans typescript@2.0.3
164 verbose rebuildBundles typescript@2.0.3
165 silly gentlyRm /usr/local/bin/tsc is being gently removed
166 silly gentlyRm verifying /usr/local is an npm working directory
167 silly gentlyRm containing path /usr/local is under npm's control, in /usr/local
168 silly gentlyRm deletion target /usr/local/bin/tsc is under /usr/local
169 verbose gentlyRm vacuuming from /usr/local/bin/tsc up to /usr/local
170 silly gentlyRm /usr/local/bin/tsserver is being gently removed
171 silly gentlyRm verifying /usr/local is an npm working directory
172 silly gentlyRm containing path /usr/local is under npm's control, in /usr/local
173 silly gentlyRm deletion target /usr/local/bin/tsserver is under /usr/local
174 verbose gentlyRm vacuuming from /usr/local/bin/tsserver up to /usr/local
175 info install typescript@2.0.3
176 info postinstall typescript@2.0.3
177 verbose unlock done using /Users/iancray/.npm/_locks/typescript-5355178f5d1a073f.lock for /usr/local/lib/node_modules/typescript
178 verbose validateInstall loading /usr/local/lib/package.json for validation
179 verbose stack Error: The package webpack@2.1.0-beta.22 does not satisfy its siblings' peerDependencies requirements!
179 verbose stack     at /usr/local/lib/node_modules/npm/lib/install.js:125:32
179 verbose stack     at /usr/local/lib/node_modules/npm/lib/install.js:268:7
179 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-installed/read-installed.js:142:5
179 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-installed/read-installed.js:263:14
179 verbose stack     at cb (/usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:47:24)
179 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-installed/read-installed.js:263:14
179 verbose stack     at cb (/usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:47:24)
179 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-installed/read-installed.js:263:14
179 verbose stack     at cb (/usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:47:24)
179 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-installed/read-installed.js:263:14
180 verbose cwd /Users/iancray/Angular2
181 error Darwin 16.1.0
182 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "typescript"
183 error node v4.5.0
184 error npm  v2.15.9
185 error code EPEERINVALID
186 error peerinvalid The package webpack@2.1.0-beta.22 does not satisfy its siblings' peerDependencies requirements!
186 error peerinvalid Peer html-webpack-plugin@2.22.0 wants webpack@*
186 error peerinvalid Peer karma-webpack@1.8.0 wants webpack@^1.1.0 || ^2 || ^2.1.0-beta
186 error peerinvalid Peer sass-loader@3.2.3 wants webpack@^1.12.6 || ^2.1.0-beta
186 error peerinvalid Peer string-replace-loader@1.0.5 wants webpack@1 || 2 || ^2.0.0-beta || ^2.1.0-beta
186 error peerinvalid Peer webpack-dev-server@2.1.0-beta.3 wants webpack@^2.1.0-beta
187 verbose exit [ 1, true ]

Lorem ipsum dolor sit amet,consectetur adipiscing elit,sed do eiusmod tempor incididunt ut labore et dolore magna aliqua。 Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat。 Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur。 Exceptioneur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum。

【问题讨论】:

添加了lipsum,因为堆栈溢出不允许我添加调试日志。所以射我吧。 【参考方案1】:

与 Typescript 无关,NPM 告诉你你的 Webpack 版本与你拥有的其他模块不兼容,输入 npm install webpack 安装当前的 Webpack 版本(非 beta)来解决问题。

顺便说一句,即使使用 EPEERINVALID Typescript 也应该安装,尝试tsc --help 进行检查。

【讨论】:

为什么没有教程将此列为一个步骤? 因为它不是一个步骤,它是bug解决,也许你遵循的教程已经过时了,因为它们似乎鼓励你使用Webpack beta

以上是关于无法运行 sudo npm install -g typescript的主要内容,如果未能解决你的问题,请参考以下文章

`npm install`卡住不动,使用`sudo npm install`就可以下载依赖包

命令'/ bin / sh -c npm install'返回非零代码:1

[Tools] Install npm packages globally without sudo on macOS and Linux

sh 使用这些技术之一安装节点和npm而不必sudo。在http://joyeur.com/2010/12/10/instal上详细讨论

sh 使用这些技术之一安装节点和npm而不必sudo。在http://joyeur.com/2010/12/10/instal上详细讨论

sh 使用这些技术之一安装节点和npm而不必sudo。在http://joyeur.com/2010/12/10/instal上详细讨论