-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] NMP v7 error on install — 'must provide string spec' #2117
Comments
can you try again with npm 7.0.8? i wasn't able to reproduce this in either node 14.15.0 or 15.0.1 when using npm 7.0.8 |
Yes 7.0.8 appears to have fixed the problem. |
% npm install config % node --version % npm --version |
In my case it happened when I had a git conflict in |
I can't reproduce this w/ |
@wraithgar unless npm has a feature of auto-resolving merge conflict in |
Merge conflicts can be (usually) solved by using https://github.com/npm/npm-merge-driver |
I'm getting this on Windows 10 (MSFT corpnet/VPN) with npm 7.0.0 after cloning: git clone https://github.com/Azure-Samples/azure-cosmos-db-cassandra-nodejs-getting-started.git Then running: npm install No lock file but the package.json file does look unusual: {
"name": "packages.json",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"assert": "^1.4.1",
"async": "^2.5.0",
"cassandra-driver": "^3.3.0",
"dateformat": "^3.0.2",
"long": {
"integrity": "sha1-n6GAux2VAM3CnEFWdmoZleH0Uk8=",
"resolved": "https://registry.npmjs.org/long/-/long-2.4.0.tgz",
"version": "2.4.0"
},
"system-sleep": "^1.3.6"
}
} |
@diberry can you try npm v7.5.3? v7.0.0 is missing a great many bug fixes. |
I'm having the same problem. > node --version
v15.11.0
> npm --version
7.6.0
> npm install
npm ERR! must provide string spec
npm ERR! A complete log of this run can be found in:
npm ERR! /home/jgl/.npm/_logs/2021-03-04T10_59_06_851Z-debug.log
> cat /home/jgl/.npm/_logs/2021-03-04T10_59_06_851Z-debug.log
0 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install' ]
1 info using [email protected]
2 info using [email protected]
3 timing config:load:defaults Completed in 0ms
4 timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 1ms
5 timing config:load:builtin Completed in 1ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 0ms
8 timing config:load:file:/home/jgl/dev/walcu/mapp/webclient/.npmrc Completed in 0ms
9 timing config:load:project Completed in 0ms
10 timing config:load:file:/home/jgl/.npmrc Completed in 1ms
11 timing config:load:user Completed in 1ms
12 timing config:load:file:/usr/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 4ms
19 verbose npm-session d9a89f826c253f16
20 timing npm:load Completed in 8ms
21 timing arborist:ctor Completed in 1ms
22 timing idealTree Completed in 6ms
23 timing command:install Completed in 15ms
24 verbose stack TypeError: must provide string spec
24 verbose stack at new Edge (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/edge.js:48:13)
24 verbose stack at Node.[_loadDepType] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:771:9)
24 verbose stack at Node.[Arborist.Node._loadDeps] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/nod
e.js:758:23)
24 verbose stack at new Node (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:231:20)
24 verbose stack at Arborist.[rootNodeFromPackage] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arb
orist/build-ideal-tree.js:355:18)
25 verbose cwd /home/jgl/dev/walcu/mapp/webclient
26 verbose Linux 5.11.2-arch1-1
27 verbose argv "/usr/bin/node" "/usr/bin/npm" "install"
28 verbose node v15.11.0
29 verbose npm v7.6.0
30 error must provide string spec
31 verbose exit 1 |
I also experienced this annoying bug after upgrading npm (on Ubuntu 18.04, installed via nodesource). {
npm: '7.6.1',
node: '14.15.5',
v8: '8.4.371.19-node.18',
uv: '1.40.0',
zlib: '1.2.11',
brotli: '1.0.9',
ares: '1.16.1',
modules: '83',
nghttp2: '1.41.0',
napi: '7',
llhttp: '2.1.3',
openssl: '1.1.1i',
cldr: '37.0',
icu: '67.1',
tz: '2020a',
unicode: '13.0'
} I reinstalled {
npm: '6.14.11',
ares: '1.16.1',
brotli: '1.0.9',
cldr: '37.0',
icu: '67.1',
llhttp: '2.1.3',
modules: '83',
napi: '7',
nghttp2: '1.41.0',
node: '14.16.0',
openssl: '1.1.1j',
tz: '2020a',
unicode: '13.0',
uv: '1.40.0',
v8: '8.4.371.19-node.18',
zlib: '1.2.11'
} This fixed the issue. Is npm 7.x not compatible with node 14.x? If so, why is it upgraded by |
npm 7.x is definitely supported on node 14 are any of you able to create a reproduction case for this? if you’re able to share your package.json and package-lock.json that would help too. we haven’t been able to reproduce this one, so any help in that would be the first step toward getting it fixed |
I had this problem on Ubuntu 18.04 with NPM 7.6.0 and NodeJS v15.11.0. Got the error "must provide string spec" and the debug log did not have a smoking gun in it. I kicked my tiny package.json and created a new one, and then reinstalled all dependencies without issues. Did not need to downgrade NPM, could not reproduce the problem after that. |
To solve it, I had to delete package-lock.json file. |
I solve the problem by downgrade npm to 6.X.X .... |
To solve I had to delete the package.json file. |
I also need help with this, I'm using node v15.8.0, and I get 'must provide a string spec' when I try to npm install passport passport-discord. Are there any suggestion on which node version I should use or anything else that could fix |
Deleting |
In my case I had
Since I've used it to leave comments in package.json. After removing - works fine |
Strangely enough, on my machine this happens only on Windows 10 / WSL with nodejs 7.x.x installed. Logfile 2021-06-21T18_29_07_396Z-debug.log:
Solution: Downgrade npm to 6.14.11 with |
I'm having the same issue with npm v7.20 and NodeJS v16. I using create-react-app when running into this error. I had to downgrade to NPM v6.14 since that's the only solution that seemed to work. What's going on? |
I'm having the same issue with npm 7.21.1 |
That was the actual problem, in npm versions > 6.14 the |
Try deleting package-lock.json file and try again -> npm i |
For me it was the old browserslist syntax in package.json:
After removing this verything works with npm 7-8. |
I just had the must provide string spec error when trying to run nmp install puppeteer Everything was okay until I ran npm install npm -g, before running npm install -g typescript So I tried npm install -g puppeteer and it worked without error |
this worked for me. |
Current Behavior:
Trying to run
npm install
on my projectapi-server-boilerplate
gives errorFull error log
Expected Behaviour:
I expected it to install as per normal, or at least get an error that tells me what to do to fix it.
I have searched for this "must provide string spec" and can't find any results.
The only fix is to roll back npm to v6
Steps To Reproduce:
Environment:
The text was updated successfully, but these errors were encountered: