I keep getting this error message when I try to use npm run deploy.
However, I do seem to have a deploy script in my package.json file
I am also cded into the package.json directory
I have tried turning github pages on but when I go to the link it gives me a 404 error
As a result I have turned off github pages
Extended Error message (npm debug log):
14 verbose lifecycle myportfoliosite#0.1.0~deploy: CWD: C:\Users\Ali Haider\AppData\Roaming\npm\node_modules\create-react-app\myportfoliosite\myportfoliosite
15 silly lifecycle myportfoliosite#0.1.0~deploy: Args: [ '/d /s /c', 'gh-pages -d build' ]
16 silly lifecycle myportfoliosite#0.1.0~deploy: Returned: code: 1 signal: null
17 info lifecycle myportfoliosite#0.1.0~deploy: Failed to exec deploy script
18 verbose stack Error: myportfoliosite#0.1.0 deploy: `gh-pages -d build`
18 verbose stack Exit status 1
18 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
18 verbose stack at EventEmitter.emit (events.js:198:13)
18 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
18 verbose stack at ChildProcess.emit (events.js:198:13)
18 verbose stack at maybeClose (internal/child_process.js:982:16)
18 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
19 verbose pkgid myportfoliosite#0.1.0
20 verbose cwd C:\Users\Ali Haider\AppData\Roaming\npm\node_modules\create-react-app\myportfoliosite\myportfoliosite
21 verbose Windows_NT 10.0.17134
22 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "deploy"
23 verbose node v10.16.0
24 verbose npm v6.9.0
25 error code ELIFECYCLE
26 error errno 1
27 error myportfoliosite#0.1.0 deploy: `gh-pages -d build`
27 error Exit status 1
28 error Failed at the myportfoliosite#0.1.0 deploy script.
28 error This is probably not a problem with npm. There is likely additional logging output above.
29 verbose exit [ 1, true ]
File sizes after gzip:
73.02 KB build\static\js\2.f6e5e996.chunk.js
19.04 KB build\static\css\2.b1979bb4.chunk.css
797 B build\static\js\runtime~main.4f085a03.js
152 B build\static\js\main.a0a932a3.chunk.js
The project was built assuming it is hosted at /InquisitiveDev2016/ReactDeveloperPortfolio/.
You can control this with the homepage field in your package.json.
The build folder is ready to be deployed.
Find out more about deployment here:
Error appearing in terminal:
> myportfoliosite#0.1.0 deploy C:\Users\Ali Haider\AppData\Roaming\npm\node_modules\create-react-app\myportfoliosite\myportfoliosite
> gh-pages -d build
'gh-pages' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myportfoliosite#0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myportfoliosite#0.1.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Ali Haider\AppData\Roaming\npm-cache\_logs\2019-06-29T02_08_30_836Z-debug.log
Here is my repository: https://github.com/InquisitiveDev2016/ReactDeveloperPortfolio
My json folder:
{
"name": "myportfoliosite",
"version": "0.1.0",
"private": true,
"homepage": "https://github.com/InquisitiveDev2016/ReactDeveloperPortfolio",
"dependencies": {
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-mdl": "^1.11.0",
"react-router-dom": "^5.0.1",
"react-scripts": "3.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
check your folder tree there you might find build folder there delete catch folder and save then run npm run deploy
Related
When I run npm install I get the following error below and I don't have an idea how I could fix it. I tried digging into that error log to resolve those dependencies but all not no avail. I will appreciate any lead to resolve this problem. It is my React first code. Thanks in anticipation!
Error Log
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: #babel/core#7.2.2
npm ERR! node_modules/#babel/core
npm ERR! #babel/core#"7.2.2" from react-scripts#2.1.8
npm ERR! node_modules/react-scripts
npm ERR! react-scripts#"^2.1.3" from the root project
npm ERR! peer react-scripts#">=2.1.3" from react-app-rewired#2.1.8
npm ERR! node_modules/react-app-rewired
npm ERR! react-app-rewired#"^2.1.0" from the root project
npm ERR! #babel/core#"^7.1.6" from #svgr/webpack#4.1.0
npm ERR! node_modules/#svgr/webpack
npm ERR! #svgr/webpack#"4.1.0" from react-scripts#2.1.8
npm ERR! node_modules/react-scripts
npm ERR! react-scripts#"^2.1.3" from the root project
npm ERR! 1 more (react-app-rewired)
npm ERR! 8 more (babel-core, babel-loader, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #babel/core#"^7.13.0" from #babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining#7.13.12
npm ERR! node_modules/#babel/preset-env/node_modules/#babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining
npm ERR! #babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining#"^7.13.12" from #babel/preset-env#7.14.1
npm ERR! node_modules/#babel/preset-env
npm ERR! #babel/preset-env#"^7.1.6" from #svgr/webpack#4.1.0
npm ERR! node_modules/#svgr/webpack
npm ERR! #svgr/webpack#"4.1.0" from react-scripts#2.1.8
npm ERR! node_modules/react-scripts
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/tiwa/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/tiwa/.npm/_logs/2021-05-11T18_39_17_361Z-debug.log
package.json
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"#material-ui/core": "^4.0.0",
"eslint": "^6.0.1",
"ipfs-api": "^26.1.2",
"json-loader": "^0.5.7",
"node-sass": "^4.11.0",
"react": "^16.8.6",
"react-app-rewired": "^2.1.0",
"react-bootstrap": "^1.0.0-beta.5",
"react-dom": "^16.8.6",
"react-router-dom": "^5.0.0",
"react-scripts": "^2.1.3",
"react-toggle": "^4.0.2",
"rimble-ui": "^0.7.0",
"styled-components": "^4.1.3",
"web3": "1.0.0-beta.37",
"zeppelin-solidity-hot-loader": "^1.2.3"
},
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"devDependencies": {}
}
npm version
7.0.8
node version
v15.2.1
Log File
GNU nano 2.0.6
File: /Users/tiwa/.npm/_logs/2021-05-12T10_58_57_849Z-debug.log
0 verbose cli [
0 verbose cli '/Users/tiwa/.asdf/installs/nodejs/15.2.1/bin/node',
0 verbose cli '/Users/tiwa/.asdf/installs/nodejs/15.2.1/bin/npm',
0 verbose cli 'run',
0 verbose cli 'client'
0 verbose cli ]
1 info using npm#7.0.8
2 info using node#v15.2.1
3 timing config:load:defaults Completed in 2ms
4 timing config:load:file:/Users/tiwa/.asdf/installs/nodejs/15.2.1/lib/node_modules/npm/npmrc Completed in 2ms
5 timing config:load:builtin Completed in 2ms
6 timing config:load:cli Completed in 2ms
7 timing config:load:env Completed in 0ms
8 timing config:load:file:/Users/tiwa/WebstormProjects/nft/.npmrc Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:/Users/tiwa/.npmrc Completed in 1ms
11 timing config:load:user Completed in 1ms
12 timing config:load:file:/Users/tiwa/.asdf/installs/nodejs/15.2.1/.npm/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 3ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 1ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 13ms
19 verbose npm-session ed61a70477c00f22
20 timing npm:load Completed in 23ms
21 timing command:run-script Completed in 34358ms
22 verbose stack Error: command failed
22 verbose stack at ChildProcess.<anonymous> (/Users/tiwa/.asdf/installs/nodejs/15.2.1/lib/node_modules/npm/node_modules/#npmcli/promise-spawn/index.js:64:27)
22 verbose stack at ChildProcess.emit (node:events:329:20)
22 verbose stack at maybeClose (node:internal/child_process:1055:16)
22 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:288:5)
23 verbose pkgid NFT-based-photo-marketplace#1.0.0
24 verbose cwd /Users/tiwa/WebstormProjects/nft
25 verbose Darwin 20.3.0
26 verbose argv "/Users/tiwa/.asdf/installs/nodejs/15.2.1/bin/node" "/Users/tiwa/.asdf/installs/nodejs/15.2.1/bin/npm" "run" "client"
27 verbose node v15.2.1
28 verbose npm v7.0.8
29 error code 1
30 error path /Users/tiwa/WebstormProjects/nft
31 error command failed
32 error command sh -c cd client && npm run start
Have you tried removing node_modules/ and package-lock.js and then run npm install command?
npm 7 requires peer dependencies to be installed when most React projects still declare this as optional.
You can install using npm i --legacy-peer-deps or set this in your .npmrc:
npm set config legacy-peer-deps=true
are you sure, you are doing npm install in the correct folder? First cd into the correct folder in the terminal where you need to install and then run below command -
npm ci
Generally, I've found that yarn provides better info than npm in case of an error. Could you possibly share a (gist) link to /Users/tiwa/.npm/_logs/2021-05-11T18_39_17_361Z-debug.log?
I'm currently trying to deploy my app with netlify, but the problem is that I clone my app into my new computer, and now I'm getting some issues.
> todolistv2#1.0.0 start /Users/hvaandres/Documents/GitHub/TodoList_React
> npm run build
npm ERR! missing script: build
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/hvaandres/.npm/_logs/2021-03-04T06_19_54_506Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! todolistv2#1.0.0 start: `npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the todolistv2#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/hvaandres/.npm/_logs/2021-03-04T06_19_54_546Z-debug.log
I ran the following command npm install and I'm still getting the same issue. This is my debug log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'deploy' ]
2 info using npm#6.14.11
3 info using node#v14.15.5
4 verbose run-script [ 'predeploy', 'deploy', 'postdeploy' ]
5 info lifecycle todolistv2#1.0.0~predeploy: todolistv2#1.0.0
6 info lifecycle todolistv2#1.0.0~deploy: todolistv2#1.0.0
7 verbose lifecycle todolistv2#1.0.0~deploy: unsafe-perm in lifecycle true
8 verbose lifecycle todolistv2#1.0.0~deploy: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/hvaandres/Documents/GitHub/TodoList_React/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
9 verbose lifecycle todolistv2#1.0.0~deploy: CWD: /Users/hvaandres/Documents/GitHub/TodoList_React
10 silly lifecycle todolistv2#1.0.0~deploy: Args: [ '-c', 'npm run build && gh-pages -d build' ]
11 silly lifecycle todolistv2#1.0.0~deploy: Returned: code: 1 signal: null
12 info lifecycle todolistv2#1.0.0~deploy: Failed to exec deploy script
13 verbose stack Error: todolistv2#1.0.0 deploy: `npm run build && gh-pages -d build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1048:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid todolistv2#1.0.0
15 verbose cwd /Users/hvaandres/Documents/GitHub/TodoList_React
16 verbose Darwin 19.6.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "deploy"
18 verbose node v14.15.5
19 verbose npm v6.14.11
20 error code ELIFECYCLE
21 error errno 1
22 error todolistv2#1.0.0 deploy: `npm run build && gh-pages -d build`
22 error Exit status 1
23 error Failed at the todolistv2#1.0.0 deploy script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
My package.json:
{
"name": "todolistv2",
"version": "1.0.0",
"description": "Todo-List",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "npm run build"
},
"keywords": [
"react",
"todolist_project"
],
"author": "Alan A. Haro",
"license": "ISC",
"dependencies": {
"react-icons": "^3.11.0"
}
}
If someone can help me, I would really appreciate it. I'm just trying to learn more.
Step 1
you need a Node and Npm in your System
Click here for installing Node.js and npm
Step 2
delete Package-lock.json file
Step 3
For installing Node Modules :
Run Command npm install
Step 4
Run Command npm start
if not working then try Command
npm run build
or
npm run dev
if Still not working then open package.json file
and check
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "npm run build" // your script code is "npm run build"
},
Your package JSON file appears to be missing both a start and build command. Add them back in. These are the defaults for newly created React apps using create-react-app. You also appear to be missing dependencies, namely react and react-dom.
{
"name": "todolistv2",
"version": "1.0.0",
"description": "Todo-List",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "react-scripts start",
"build": "react-scripts build"
},
"keywords": [
"react",
"todolist_project"
],
"author": "Alan A. Haro",
"license": "ISC",
"dependencies": {
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-icons": "^3.11.0",
... add any other missing dependencies!!
}
}
I tried looking it up on older posts and I've tried the usual reinstall modules/clean npm cache. The code runs fine with npm start on localhost but whenever I try build/deploy the project I get the following:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build'
1 verbose cli ]
2 info using npm#6.14.10
3 info using node#v14.15.4
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle portfolio#0.1.0~prebuild: portfolio#0.1.0
6 info lifecycle portfolio#0.1.0~build: portfolio#0.1.0
7 verbose lifecycle portfolio#0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle portfolio#0.1.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;F:\JS_Learn\porfolio1\portfolio\node_modules\.bin;C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;F:\JS_Learn\porfolio1\portfolio\node_modules\.bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\nodejs\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Users\belch\AppData\Roaming\npm;
9 verbose lifecycle portfolio#0.1.0~build: CWD: F:\JS_Learn\porfolio1\portfolio
10 silly lifecycle portfolio#0.1.0~build: Args: [ '/d /s /c', 'react-scripts build' ]
11 silly lifecycle portfolio#0.1.0~build: Returned: code: 1 signal: null
12 info lifecycle portfolio#0.1.0~build: Failed to exec build script
13 verbose stack Error: portfolio#0.1.0 build: `react-scripts build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1048:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid portfolio#0.1.0
15 verbose cwd F:\JS_Learn\porfolio1\portfolio
16 verbose Windows_NT 10.0.19042
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v14.15.4
19 verbose npm v6.14.10
20 error code ELIFECYCLE
21 error errno 1
22 error portfolio#0.1.0 build: `react-scripts build`
22 error Exit status 1
23 error Failed at the portfolio#0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
My package.json for reference, tried to delete it and reinstall every single dependecy manually aswell:
{
"name": "portfolio",
"version": "0.1.0",
"private": true,
"dependencies": {
"#fortawesome/fontawesome-free": "^5.15.2",
"#testing-library/jest-dom": "^5.11.9",
"#testing-library/react": "^11.2.5",
"#testing-library/user-event": "^12.8.1",
"aos": "^3.0.0-beta.6",
"emailjs-com": "^2.6.4",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-lazyload": "^3.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"react-spring": "^8.0.27",
"web-vitals": "^1.1.0"
},
"homepage": "http://MyUserJustIgnore.github.io/portfoliov1",
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"gh-pages": "^3.1.0"
}
}
I cloned a react-native project from github to work on, but npm start fails and reads this:
Error: Cannot find module 'minizlib'
Require stack:
- /usr/local/lib/node_modules/expo-cli/node_modules/tar/lib/pack.js
- /usr/local/lib/node_modules/expo-cli/node_modules/tar/lib/create.js
- /usr/local/lib/node_modules/expo-cli/node_modules/tar/index.js
- /usr/local/lib/node_modules/expo-cli/node_modules/#expo/xdl/build/Extract.js
- /usr/local/lib/node_modules/expo-cli/node_modules/#expo/xdl/build/Api.js
- /usr/local/lib/node_modules/expo-cli/node_modules/#expo/xdl/build/xdl.js
- /usr/local/lib/node_modules/expo-cli/build/exp.js
- /usr/local/lib/node_modules/expo-cli/bin/expo.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
at Function.Module._load (internal/modules/cjs/loader.js:527:27)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/usr/local/lib/node_modules/expo-cli/node_modules/tar/lib/pack.js:28:14)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # start: `expo start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/yeastbeast/.npm/_logs/2019-07-07T13_59_02_331Z-debug.log
Here is the debug log file:
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using npm#6.9.0
3 info using node#v12.6.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle #~prestart: #
6 info lifecycle #~start: #
7 verbose lifecycle #~start: unsafe-perm in lifecycle true
8 verbose lifecycle #~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/geoffrey/mhs-protect/node_modules/.bin:/home/geoffrey/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle #~start: CWD: /home/geoffrey/mhs-protect
10 silly lifecycle #~start: Args: [ '-c', 'expo start' ]
11 silly lifecycle #~start: Returned: code: 1 signal: null
12 info lifecycle #~start: Failed to exec start script
13 verbose stack Error: # start: `expo start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:203:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:203:13)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid #
15 verbose cwd /home/geoffrey/mhs-protect
16 verbose Linux 4.18.0-25-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v12.6.0
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error # start: `expo start`
22 error Exit status 1
23 error Failed at the # start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
I have tried installing and reinstalling minizlib, npm, and node, and also a handful of possible solutions found in similar questions here, but have had no success. Any help would be appreciated.
Os: Ubuntu 18.04.2
link to github repo
Edit:
I'm not quite sure what happened but it does seem to working. I opened the project today to see if anything changed and received some warnings about vulnerabilities. To fix them i reinstalled expo-cli and now all seems to be working correctly.
Your package.json files contains this,
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject"
},
"dependencies": {
"braces": "^2.3.1",
"expo": "^32.0.0",
"firebase": "^6.1.0",
"react": "16.5.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
"react-navigation": "^3.11.0",
"ws": "^3.3.3"
},
"devDependencies": {
"babel-preset-expo": "^5.0.0"
},
"private": true
}
package.json file don't have entry for minizlib package. Also node_modules folder don't have minizlib folder.
Probably missing to install the same, you can do this,
npm install minizlib --save //here `--save` will create entry into `package.json` file
After installing this package you need to restart your app.
npm install -g npm#latest (to update npm).
rm -rf node_modules (to remove the existing modules).
npm install (to re-install the project dependencies).
I created a new project, totally blank using these instructions:
https://developer.microsoft.com/en-us/fabric#/get-started
Follow steps 1-4
The application works fine.
Once I run npm i webpack
Then I get this error
my package.json
{
"name": "lulo",
"version": "0.1.0",
"private": true,
"dependencies": {
"office-ui-fabric-react": "^6.157.0",
"react": "^16.8.4",
"react-adal": "^0.4.22",
"react-dom": "^16.8.4",
"react-scripts-ts": "3.1.0",
"redux": "^4.0.1"
},
"scripts": {
"start": "react-scripts-ts start",
"build": "react-scripts-ts build",
"test": "react-scripts-ts test --env=jsdom",
"eject": "react-scripts-ts eject"
},
"devDependencies": {
"#types/jest": "^24.0.11",
"#types/node": "^11.11.3",
"#types/react": "^16.8.8",
"#types/react-adal": "^0.4.1",
"#types/react-dom": "^16.8.2",
"typescript": "^3.3.3333",
"webpack": "^4.29.6",
"webpack-cli": "^3.3.0"
}
}
the error is this:
Creating an optimized production build...
Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
Failed to compile.
Cannot read property 'thisCompilation' of undefined
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lulo#0.1.0 build: `react-scripts-ts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lulo#0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/luisvalencia/.npm/_logs/2019-03-19T21_18_01_997Z-debug.log
and the log file has this
0 info it worked if it ends with ok
1 verbose cli [ '/Users/x/.nvm/versions/node/v10.0.0/bin/node',
1 verbose cli '/Users/x/.nvm/versions/node/v10.0.0/bin/npm',
1 verbose cli 'run-script',
1 verbose cli 'build' ]
2 info using npm#5.6.0
3 info using node#v10.0.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle lulo#0.1.0~prebuild: lulo#0.1.0
6 info lifecycle lulo#0.1.0~build: lulo#0.1.0
7 verbose lifecycle lulo#0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle lulo#0.1.0~build: PATH: /Users/x/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/x/Lulo/lulo/node_modules/.bin:/Users/x/.nvm/versions/node/v10.0.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle lulo#0.1.0~build: CWD: /Users/x/Lulo/lulo
10 silly lifecycle lulo#0.1.0~build: Args: [ '-c', 'react-scripts-ts build' ]
11 silly lifecycle lulo#0.1.0~build: Returned: code: 1 signal: null
12 info lifecycle lulo#0.1.0~build: Failed to exec build script
13 verbose stack Error: lulo#0.1.0 build: `react-scripts-ts build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/Users/x/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess.<anonymous> (/Users/x/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:182:13)
13 verbose stack at maybeClose (internal/child_process.js:947:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:236:5)
14 verbose pkgid lulo#0.1.0
15 verbose cwd /Users/luisvalencia/Lulo/lulo
16 verbose Darwin 18.0.0
17 verbose argv "/Users/x/.nvm/versions/node/v10.0.0/bin/node" "/Users/x/.nvm/versions/node/v10.0.0/bin/npm" "run-script" "build"
18 verbose node v10.0.0
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error lulo#0.1.0 build: `react-scripts-ts build`
22 error Exit status 1
23 error Failed at the lulo#0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
This thread has the answer:
https://github.com/facebook/create-react-app/issues/4076
Basically, delete node_modules and remove webpack from package.json dependencies, then npm install. Some people resolved by using yarn instead of npm.
I too struggled to resolve this error for quite sometime. The problem in my case was due to transitive dependency. Although, "webpack" was not explicitly mentioned as dependency in my project package.json, I found 2 versions of "webpack" in package-lock.json. One was used by "react-scripts" and other by "react-nbsp", which I had mentioned as dependency in package.json, and was using it to get non breaking space in React JSX.
I removed "react-nbsp" from package.json, deleted node-modules, package-lock.json and ran the application. It started without error and worked fine.