Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[BUG] "ERR! must provide string spec" when running "npm install" #2843

Closed
6uzm4n opened this issue Mar 9, 2021 · 5 comments
Closed

[BUG] "ERR! must provide string spec" when running "npm install" #2843

6uzm4n opened this issue Mar 9, 2021 · 5 comments
Assignees
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release

Comments

@6uzm4n
Copy link

6uzm4n commented Mar 9, 2021

Current Behavior:

When I run "npm install" in one specific project, I get the message:

npm ERR! must provide string spec

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/guzman/.npm/_logs/2021-03-09T09_43_59_525Z-debug.log

The log file:

0 verbose cli [
0 verbose cli   '/usr/local/bin/node',
0 verbose cli   '/home/guzman/.npm-global/bin/npm',
0 verbose cli   'install'
0 verbose cli ]
1 info using npm@7.6.1
2 info using node@v15.11.0
3 timing config:load:defaults Completed in 2ms
4 timing config:load:file:/home/guzman/.npm-global/lib/node_modules/npm/npmrc Completed in 2ms
5 timing config:load:builtin Completed in 2ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 0ms
8 timing config:load:file:/home/guzman/Walcu/MAPP-WebClient/.npmrc Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:/home/guzman/.npmrc Completed in 1ms
11 timing config:load:user Completed in 1ms
12 timing config:load:file:/home/guzman/.npm-global/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 1ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 9ms
19 verbose npm-session ad4e6429afd3d43d
20 timing npm:load Completed in 17ms
21 timing arborist:ctor Completed in 1ms
22 timing idealTree Completed in 4ms
23 timing command:install Completed in 18ms
24 verbose stack TypeError: must provide string spec
24 verbose stack     at new Edge (/home/guzman/.npm-global/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/edge.js:48:13)
24 verbose stack     at Node.[_loadDepType] (/home/guzman/.npm-global/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:771:9)
24 verbose stack     at Node.[Arborist.Node._loadDeps] (/home/guzman/.npm-global/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:758:23)
24 verbose stack     at new Node (/home/guzman/.npm-global/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:231:20)
24 verbose stack     at Arborist.[rootNodeFromPackage] (/home/guzman/.npm-global/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:355:18)
25 verbose cwd /home/guzman/Walcu/MAPP-WebClient
26 verbose Linux 5.9.16-1-MANJARO
27 verbose argv "/usr/local/bin/node" "/home/guzman/.npm-global/bin/npm" "install"
28 verbose node v15.11.0
29 verbose npm  v7.6.1
30 error must provide string spec
31 verbose exit 1

Expected Behavior:

The instalation happens normaly

Steps To Reproduce:

I'm running the command with a fresh install of node and npm. It works well in other projects.

Environment:

  • OS: Manjaro
  • Node: 15.11.0
  • npm: 7.6.1
@6uzm4n 6uzm4n added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Mar 9, 2021
@6uzm4n
Copy link
Author

6uzm4n commented Mar 9, 2021

Hey @neyb I saw the issue you related. Are you able to fix it just by adding "cache":"~/.npm" to the package.json root?

@neyb
Copy link

neyb commented Mar 10, 2021

Hi the problem I encounter was related to a default option not being applied. While it could be the origin of the big you encounter, then the workaround wouldn't work in your case

@neyb
Copy link

neyb commented Mar 10, 2021

Looking at the code make me think npm does not find the spec (version) of a dependency. In which case the problem is probably not default options.

@wraithgar
Copy link
Member

I believe this PR may fix the issue: #2834

If you define a publishConfig, it pushes the defaults out the window, that PR makes sure all publishConfigs (including the defualts) are represented in the final opts that are generated.

@wraithgar wraithgar self-assigned this Mar 15, 2021
@wraithgar wraithgar removed the Needs Triage needs review for next steps label Mar 15, 2021
@wraithgar
Copy link
Member

This should be fixed in v7.7.0. The publishConfig is now being consolidated properly

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

3 participants