How do I fix npm missing script: "i" - npm

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 npm#8.15.0
2 info using node#v16.17.0
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

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

When trying to publish an npm package I get the following error: Did you mean to publish ./package/, instead of ./?

I'm trying to publish my first npm package, but there seems to be something that I'm missing.
I have already tested the package with npm link and everything works as expected, however I am unable to publish it. I seem to be missing something, but can't find what it is.
Running npm publish or npm publish --dry-run give me the following error:
npm ERR!
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c echo 'Did you mean to publish ./package/, instead of ./?' && exit 1
My environment is:
Svelte + Svelte kit
Vite
Typescript
My vite config is:
import { sveltekit } from '#sveltejs/kit/vite';
/** #type {import('vite').UserConfig} */
const config = {
plugins: [sveltekit()]
};
export default config;
This is the complete log of the error:
0 verbose cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
1 info using npm#8.11.0
2 info using node#v16.16.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:C:\Users\user1\AppData\Roaming\nvm\v16.16.0\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:C:\Users\user1\Namu\sveltekit-auth0\.npmrc Completed in 1ms
10 timing config:load:project Completed in 4ms
11 timing config:load:file:C:\Users\user1\.npmrc Completed in 0ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:C:\Program Files\nodejs\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 1ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 12ms
19 timing npm:load:configload Completed in 12ms
20 timing npm:load:mkdirpcache Completed in 1ms
21 timing npm:load:mkdirplogs Completed in 1ms
22 verbose title npm publish
23 verbose argv "publish" "--dry-run"
24 timing npm:load:setTitle Completed in 1ms
25 timing config:load:flatten Completed in 2ms
26 timing npm:load:display Completed in 3ms
27 verbose logfile logs-max:10 dir:C:\Users\user1\AppData\Local\npm-cache\_logs
28 verbose logfile C:\Users\user1\AppData\Local\npm-cache\_logs\2023-01-02T20_06_32_635Z-debug-0.log
29 timing npm:load:logFile Completed in 4ms
30 timing npm:load:timers Completed in 0ms
31 timing npm:load:configScope Completed in 0ms
32 timing npm:load Completed in 22ms
33 verbose publish [ '.' ]
34 silly logfile start cleaning logs, removing 6 files
35 timing command:publish Completed in 63ms
36 verbose stack Error: command failed
36 verbose stack at ChildProcess.<anonymous> (C:\Users\user1\AppData\Roaming\nvm\v16.16.0\node_modules\npm\node_modules\#npmcli\promise-spawn\lib\index.js:63:27)
36 verbose stack at ChildProcess.emit (node:events:527:28)
36 verbose stack at maybeClose (node:internal/child_process:1092:16)
36 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
37 verbose pkgid sveltekit-auth0#0.0.1
38 verbose cwd C:\Users\user1\Namu\sveltekit-auth0
39 verbose Windows_NT 10.0.22621
40 verbose node v16.16.0
41 verbose npm v8.11.0
42 error code 1
43 error path C:\Users\user1\Namu\sveltekit-auth0
44 error command failed
45 error command C:\WINDOWS\system32\cmd.exe /d /s /c echo 'Did you mean to publish `./package/`, instead of `./`?' && exit 1
46 verbose exit 1
47 timing npm Completed in 111ms
48 verbose code 1
49 error A complete log of this run can be found in:
49 error C:\Users\user1\AppData\Local\npm-cache\_logs\2023-01-02T20_06_32_635Z-debug-0.log
Any ideas?
I have tried modifying the vite.config.js file to something like:
import { sveltekit } from '#sveltejs/kit/vite';
import * as path from 'path';
/** #type {import('vite').UserConfig} */
const config = {
plugins: [sveltekit()],
resolve: {
alias: [
{
find: '~',
replacement: path.resolve(__dirname, './src')
}
]
},
server: {
port: 3000
},
build: {
manifest: true,
minify: true,
reportCompressedSize: true,
lib: {
entry: path.resolve(__dirname, 'auth0/auth-service.ts'),
fileName: 'auth-config',
formats: ['es', 'cjs']
},
rollupOptions: {
external: [],
plugins: [sveltekit()]
}
}
};
export default config;
And similar configurations I found online, but it always produces the same error. I must be missing something.
SvelteKit generates a package folder with a modified package.json that should be used for publishing. It lists all the exports contained in the library.
Hence you should cd into that directory and run npm publish there.

npx create-react-app with the following error code ERR_OSSL_PEM_NO_START_LINE

I have recently started learning react. When I tried running npx create-react-app I was faced with the following error:
npm ERR! code ERR_OSSL_PEM_NO_START_LINE
npm ERR! error:0909006C:PEM routines:get_name:no start line
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\tonny.nkhata\AppData\Local\npm-cache\_logs\2022-09-21T13_15_33_638Z-debug-0.log
Here is what is in my log file:
0 verbose cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
1 info using npm#8.15.0
2 info using node#v16.17.0
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 6ms
6 timing config:load:builtin Completed in 7ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:C:\Users\tonny.nkhata\Documents\react\.npmrc Completed in 1ms
10 timing config:load:project Completed in 10ms
11 timing config:load:file:C:\Users\tonny.nkhata\.npmrc Completed in 1ms
12 timing config:load:user Completed in 2ms
13 timing config:load:file:C:\Users\tonny.nkhata\AppData\Roaming\npm\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 2ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 27ms
19 timing npm:load:configload Completed in 27ms
20 timing npm:load:mkdirpcache Completed in 1ms
21 timing npm:load:mkdirplogs Completed in 1ms
22 verbose title npm exec create-react-app .
23 verbose argv "exec" "--" "create-react-app" "."
24 timing npm:load:setTitle Completed in 2ms
25 timing config:load:flatten Completed in 3ms
26 timing npm:load:display Completed in 4ms
27 verbose logfile logs-max:10 dir:C:\Users\tonny.nkhata\AppData\Local\npm-cache\_logs
28 verbose logfile C:\Users\tonny.nkhata\AppData\Local\npm-cache\_logs\2022-09-21T13_15_33_638Z-debug-0.log
29 timing npm:load:logFile Completed in 9ms
30 timing npm:load:timers Completed in 0ms
31 timing npm:load:configScope Completed in 0ms
32 timing npm:load Completed in 45ms
33 silly logfile start cleaning logs, removing 2 files
34 timing arborist:ctor Completed in 1ms
35 silly logfile done cleaning log files
36 timing command:exec Completed in 70315ms
37 verbose stack Error: error:0909006C:PEM routines:get_name:no start line
37 verbose stack at setKey (node:internal/tls/secure-context:92:11)
37 verbose stack at configSecureContext (node:internal/tls/secure-context:174:7)
37 verbose stack at Object.createSecureContext (node:_tls_common:121:3)
37 verbose stack at Object.connect (node:_tls_wrap:1626:48)
37 verbose stack at HttpsAgent.createConnection (node:https:147:22)
37 verbose stack at HttpsAgent.createConnection (C:\Program Files\nodejs\node_modules\npm\node_modules\agentkeepalive\lib\https_agent.js:29:49)
37 verbose stack at HttpsAgent.createSocket (node:_http_agent:347:26)
37 verbose stack at HttpsAgent.addRequest (node:_http_agent:294:10)
37 verbose stack at new ClientRequest (node:_http_client:326:16)
37 verbose stack at request (node:https:357:10)
38 verbose cwd C:\Users\tonny.nkhata\Documents\react
39 verbose Windows_NT 10.0.17134
40 verbose node v16.17.0
41 verbose npm v8.15.0
42 error code ERR_OSSL_PEM_NO_START_LINE
43 error error:0909006C:PEM routines:get_name:no start line
44 verbose exit 1
45 timing npm Completed in 70545ms
46 verbose code 1
47 error A complete log of this run can be found in:
47 error C:\Users\tonny.nkhata\AppData\Local\npm-cache\_logs\2022-09-21T13_15_33_638Z-debug-0.log

v8.h missing from node-gyp

I am getting the error above when executing "yarn bootstrap" inside a forked/clones repository from truffle (https://github.com/swisstackle/truffle) . I forked the repo from https://github.com/trufflesuite/truffle
Here is the last logfile:
0 verbose cli [
0 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli 'exec',
0 verbose cli '--',
0 verbose cli 'run',
0 verbose cli 'rebuild'
0 verbose cli ]
1 info using npm#8.3.1
2 info using node#v16.14.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 4ms
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 4ms
6 timing config:load:builtin Completed in 4ms
7 timing config:load:cli Completed in 3ms
8 timing config:load:env Completed in 7ms
9 timing config:load:file:C:\Users\alain\Git\truffle\node_modules\ursa-optional\.npmrc Completed in 1ms
10 timing config:load:project Completed in 3ms
11 timing config:load:file:C:\Users\alain\.npmrc Completed in 0ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:C:\Users\alain\AppData\Roaming\npm\etc\npmrc Completed in 1ms
14 timing config:load:global Completed in 1ms
15 timing config:load:validate Completed in 4ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 2ms
18 timing config:load Completed in 32ms
19 timing npm:load:configload Completed in 33ms
20 timing npm:load:setTitle Completed in 2ms
21 timing config:load:flatten Completed in 5ms
22 timing npm:load:display Completed in 6ms
23 verbose logfile C:\Users\alain\AppData\Local\npm-cache\_logs\2022-05-20T06_19_01_219Z-debug-0.log
24 timing npm:load:logFile Completed in 7ms
25 timing npm:load:timers Completed in 0ms
26 timing npm:load:configScope Completed in 0ms
27 timing npm:load Completed in 50ms
28 silly logfile start cleaning logs, removing 21 files
29 silly logfile error removing log file C:/Users/alain/AppData/Local/npm-cache/_logs/2022-05-20T05_54_36_838Z-debug-0.log [Error: EPERM: operation not permitted, unlink 'C:\Users\alain\AppData\Local\npm-cache\_logs\2022-05-20T05_54_36_838Z-debug-0.log'] {
29 silly logfile errno: -4048,
29 silly logfile code: 'EPERM',
29 silly logfile syscall: 'unlink',
29 silly logfile path: 'C:\\Users\\alain\\AppData\\Local\\npm-cache\\_logs\\2022-05-20T05_54_36_838Z-debug-0.log'
29 silly logfile }
30 silly logfile error removing log file C:/Users/alain/AppData/Local/npm-cache/_logs/2022-05-20T05_54_38_424Z-debug-0.log [Error: EPERM: operation not permitted, unlink 'C:\Users\alain\AppData\Local\npm-cache\_logs\2022-05-20T05_54_38_424Z-debug-0.log'] {
30 silly logfile errno: -4048,
30 silly logfile code: 'EPERM',
30 silly logfile syscall: 'unlink',
30 silly logfile path: 'C:\\Users\\alain\\AppData\\Local\\npm-cache\\_logs\\2022-05-20T05_54_38_424Z-debug-0.log'
30 silly logfile }
31 http fetch GET 200 https://registry.yarnpkg.com/run 265ms (cache revalidated)
32 timing arborist:ctor Completed in 1ms
33 timing arborist:ctor Completed in 0ms
34 timing arborist:ctor Completed in 0ms
35 silly logfile error removing log file C:/Users/alain/AppData/Local/npm-cache/_logs/2022-05-20T05_54_40_145Z-debug-0.log [Error: EPERM: operation not permitted, unlink 'C:\Users\alain\AppData\Local\npm-cache\_logs\2022-05-20T05_54_40_145Z-debug-0.log'] {
35 silly logfile errno: -4048,
35 silly logfile code: 'EPERM',
35 silly logfile syscall: 'unlink',
35 silly logfile path: 'C:\\Users\\alain\\AppData\\Local\\npm-cache\\_logs\\2022-05-20T05_54_40_145Z-debug-0.log'
35 silly logfile }
36 timing command:exec Completed in 373ms
37 verbose exit 1
38 timing npm Completed in 1242ms
39 verbose code 1
Ive tried multiple things that are recomended on stack overflow or other websites:
install sqlite3 manually. It looks like the earlier in the output in the commandline it says error C:\Users\alain\Git\truffle\node_modules\sqlite3: Command failed.
change yarn versions
reclone and rerun the whole thing
clear the npm cache
Install sqlite3 manually: Yarn add sqlite3 -W
Anything else I could try? I am just following the contributions.md tutorial on https://github.com/trufflesuite/truffle/blob/develop/CONTRIBUTING.md
Update: I have made some progress:
Due to the log file, I figured out that the v8.h in node-gyp was missing. I reinstalled node-gyp and that resolved the issue.
The next error that was coming up that the some file in the scripts folder of truffle still had windows white spaces, so I removed them with sed -i 's/\r//g' and that resolved the issue
Then, another issue came up, which I couldnt solve yet:
When yarn tries to build the truffle dashboard package, I am getting the error 'DISABLE_ESLINT_PLUGIN' is not recognized as an internal or external command
which is used in the package.json to run react-scripts without eslint
According to react-scripts, this tag was added with the version 4.0.2, but the package.json in the dashboard package references version 4.0.0 for react-scripts. This is a little bit confusing to me, because how could the developers at consensys build the dashboard package with this tag, if they use version 4.0.0? I will open up a separate question for that.Pro
The issue was that node-gyp had v8.h missing: I quickly resolved that be reinstalling nodegyp: npm install node-gyp -g
However, there were coming up to more errors afterwards that are unrelated to the original error. More details in the question text that I updated. I will make a seperate question for these errors.

NPM ERROR: npm ERR! could not determine executable to run

while running my application I'm facing this error: npm ERR! could not determine executable to run
The log:
cat /home/harry/.npm/_logs/2021-09-09T11_15_34_872Z-debug.log
0 verbose cli [
0 verbose cli '/usr/local/bin/node',
0 verbose cli '/usr/local/lib/node_modules/npm/bin/npm-cli.js',
0 verbose cli 'exec',
0 verbose cli '--',
0 verbose cli 'babel-node',
0 verbose cli '4-main.js'
0 verbose cli ]
1 info using npm#7.21.1
2 info using node#v16.9.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 3ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 3ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:/home/harry/HolbertonSchool/holbertonschool-web_back_end/0x0E-ES6_basic/.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:/home/harry/.npmrc Completed in 0ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:credentials Completed in 2ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 14ms
19 timing npm:load:configload Completed in 14ms
20 timing npm:load:setTitle Completed in 0ms
21 timing npm:load:setupLog Completed in 0ms
22 timing config:load:flatten Completed in 4ms
23 timing npm:load:cleanupLog Completed in 3ms
24 timing npm:load:configScope Completed in 0ms
25 timing npm:load:projectScope Completed in 0ms
26 timing npm:load Completed in 24ms
27 http fetch GET 200 https://registry.npmjs.org/babel-node 1083ms (cache miss)
28 timing command:exec Completed in 1122ms
29 verbose stack Error: could not determine executable to run
29 verbose stack at getBinFromManifest (/usr/local/lib/node_modules/npm/node_modules/libnpmexec/lib/get-bin-from-manifest.js:15:23)
29 verbose stack at exec (/usr/local/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:113:15)
30 verbose pkgid babel-node#0.0.1-security
31 verbose cwd /home/harry/HolbertonSchool/holbertonschool-web_back_end/0x0E-ES6_basic
32 verbose Linux 5.4.0-52-generic
33 verbose argv "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/bin/npm-cli.js" "exec" "--" "babel-node" "4-main.js"
34 verbose node v16.9.0
35 verbose npm v7.21.1
36 error could not determine executable to run
37 verbose exit 1
I was having a similar issue and looked at my package.json file to find that I had installed babel-node using npm babel-node rather than #babel/node
To fix it I removed "babel-node" and added "#babel/node": "7.x" then ran npm i again.

iOS ReactNative build failed on M1 mac

I created a sample ReactNative project using npx react-native “projectName” on M1 chip based Mac. Project created without any issue and android project build and ran successfully without any error on both google preview emulator and real device. However iOS build gets fail. I have installed cocoa pods using Rosetta and and installed other required packages and softwares such as home-brew, watchman, Xcode, iOS emulator..etc
But if I create an expo project it works fine without any issue on both iOS and android, However I want to know, ReactNative CLI based projects works fine on M1 chipset, If it does work then, then something might be wrong with the my development setup.
Please be kind enough to help me with this issue
This is the log file data
Blockquote
0 verbose cli [
0 verbose cli '/usr/local/bin/node',
0 verbose cli '/usr/local/lib/node_modules/npm/bin/npm-cli.js',
0 verbose cli 'exec',
0 verbose cli '--',
0 verbose cli 'react-native',
0 verbose cli 'run-ios'
0 verbose cli ]
1 info using npm#7.4.0
2 info using node#v15.6.0
3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:/usr/local/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:/Users/vihagayohan/Desktop/ReactNative/Ikman/.npmrc Completed in 1ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:/Users/vihagayohan/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/usr/local/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 6ms
19 verbose npm-session b605b9422c99c9ad
20 timing npm:load Completed in 15ms
21 timing command:exec Completed in 71201ms
22 verbose stack Error: command failed
22 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/#npmcli/promise-spawn/index.js:64:27)
22 verbose stack at ChildProcess.emit (node:events:379:20)
22 verbose stack at maybeClose (node:internal/child_process:1065:16)
22 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:296:5)
23 verbose pkgid Ikman#0.0.1
24 verbose cwd /Users/vihagayohan/Desktop/ReactNative/Ikman
25 verbose Darwin 20.1.0
26 verbose argv "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/bin/npm-cli.js" "exec" "--" "react-native" "run-ios"
27 verbose node v15.6.0
28 verbose npm v7.4.0
29 error code 1
30 error path /Users/vihagayohan/Desktop/ReactNative/Ikman
31 error command failed
32 error command sh -c react-native "run-ios"
33 verbose exit 1
0 verbose cli [
0 verbose cli '/usr/local/bin/node',
0 verbose cli '/usr/local/lib/node_modules/npm/bin/npm-cli.js',
0 verbose cli 'exec',
0 verbose cli '--',
0 verbose cli 'react-native',
0 verbose cli 'run-ios'
0 verbose cli ]
1 info using npm#7.4.0
2 info using node#v15.6.0
3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:/usr/local/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:/Users/vihagayohan/Desktop/ReactNative/Ikman/.npmrc Completed in 1ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:/Users/vihagayohan/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/usr/local/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 6ms
19 verbose npm-session b605b9422c99c9ad
20 timing npm:load Completed in 15ms
21 timing command:exec Completed in 71201ms
22 verbose stack Error: command failed
22 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/#npmcli/promise-spawn/index.js:64:27)
22 verbose stack at ChildProcess.emit (node:events:379:20)
22 verbose stack at maybeClose (node:internal/child_process:1065:16)
22 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:296:5)
23 verbose pkgid Ikman#0.0.1
24 verbose cwd /Users/vihagayohan/Desktop/ReactNative/Ikman
25 verbose Darwin 20.1.0
26 verbose argv "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/bin/npm-cli.js" "exec" "--" "react-native" "run-ios"
27 verbose node v15.6.0
28 verbose npm v7.4.0
29 error code 1
30 error path /Users/vihagayohan/Desktop/ReactNative/Ikman
31 error command failed
32 error command sh -c react-native "run-ios"
33 verbose exit 1
Thank You,
Yohan
I asked this question few days back and struggling to get a solution. So right now i have found a solution but don't know whether it's a perfect solution but so far it works fine. So basically what I did was i commented (as shown in the picture) flipper dependencies from pod file and pod install again
Try to exclude arm64 build architecture for both Pods and Project Target.
I run react native iOS on my macbook Pro with Chip M1, i got build error. But, after follow this post, i successfully running react native iOS on macbook Pro M1. The tricks is to use Rosetta and applied it to your terminal and also XCode.
full guide follow here: solve react native build failed on macbook Pro with chip M1
I just add these in Build settings > Search paths > Library search paths.
$(SDKROOT)/usr/lib/swift
Change/Add/Replace this line in your Podfile.
use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })
Define this function in your Podfile
Define find-and-replace function
def find_and_replace(dir, findstr, replacestr)
Dir[dir].each do |name|
text = File.read(name)
replace = text.gsub(findstr,replacestr)
replaced = text.index(replacestr)
if replaced == nil && text != replace
puts "Fix: " + name
File.open(name, "w") { |file| file.puts replace }
STDOUT.flush
end
end
Dir[dir + '*/'].each(&method(:find_and_replace))
end
Then call this function from the post-install so we will need to add the following 2 function calls inside post_install do |installer|
find_and_replace("Pods/RCT-Folly/folly/synchronization/DistributedMutex-inl.h",
"atomic_notify_one(state)", "folly::atomic_notify_one(state)")
find_and_replace("Pods/RCT-Folly/folly/synchronization/DistributedMutex-inl.h",
"atomic_wait_until(&state, previous | data, deadline)", "folly::atomic_wait_until(&state, previous | data, deadline)")
Run pod repo update inside the ios folder
And update your project pods using
pod install
DONE !!