Home > database >  How do I fix npm missing script: "i"
How do I fix npm missing script: "i"

Time:10-07

Technical environment : VsCode / React Native / Expo / Firebase

Hello I have a problem, following an uninstall of my packages manually, because yes I am a turkey I did it by hand by removing the package myself in package.json, following that I have this error of npm missing script "i"

Of course I did my research before I intervened on stackoverflow to ask my question.

Here is the error obtained after having launched the command npm run i (yes i its shorthand for install) :

npm ERR! Missing script: "i"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Senzo\AppData\Local\npm-cache\_logs\2022-10-07T09_55_16_344Z-debug-0.log

and here is the log I get:

1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 3ms
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 2ms
6 timing config:load:builtin Completed in 2ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:D:\AgroveV2\AgroveV2\client\.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:C:\Users\Senzo\.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:C:\Users\Senzo\AppData\Roaming\npm\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 10ms
19 timing npm:load:configload Completed in 10ms
20 timing npm:load:mkdirpcache Completed in 1ms
21 timing npm:load:mkdirplogs Completed in 0ms
22 verbose title npm run i
23 verbose argv "run" "i"
24 timing npm:load:setTitle Completed in 1ms
25 timing config:load:flatten Completed in 3ms
26 timing npm:load:display Completed in 5ms
27 verbose logfile logs-max:10 dir:C:\Users\Senzo\AppData\Local\npm-cache\_logs
28 verbose logfile C:\Users\Senzo\AppData\Local\npm-cache\_logs\2022-10-07T09_55_16_344Z-debug-0.log
29 timing npm:load:logFile Completed in 5ms
30 timing npm:load:timers Completed in 0ms
31 timing npm:load:configScope Completed in 0ms
32 timing npm:load Completed in 24ms
33 silly logfile start cleaning logs, removing 4 files
34 timing command:run Completed in 5ms
35 verbose stack Error: Missing script: "i"
35 verbose stack
35 verbose stack To see a list of scripts, run:
35 verbose stack   npm run
35 verbose stack     at RunScript.run (C:\Program Files\nodejs\node_modules\npm\lib\commands\run-script.js:98:13)
35 verbose stack     at async module.exports (C:\Program Files\nodejs\node_modules\npm\lib\cli.js:78:5)
36 verbose cwd D:\AgroveV2\AgroveV2\client
37 verbose Windows_NT 10.0.19044
38 verbose node v16.17.0
39 verbose npm  v8.15.0
40 error Missing script: "i"
40 error
40 error To see a list of scripts, run:
40 error   npm run
41 verbose exit 1
42 timing npm Completed in 43ms
43 verbose code 1
44 error A complete log of this run can be found in:
44 error     C:\Users\Senzo\AppData\Local\npm-cache\_logs\2022-10-07T09_55_16_344Z-debug-0.log

CodePudding user response:

Actually npm run use the run script in package.json.If you want to manually in the script you have a specific add below the line.

"scripts": {
  "i":"npm install
}

usually, you can try with npm i in you terminal instead of running script

  • Related