I am using VueJS for front-end and Django on back-end. For production I moved all my VueJS compiled bundel to Static/dist in django. And I blocked the content of index.html in VueJS to base.html in django. And changed the url.py such that when localhost:8000 is called it gives base.html which gives index.html of VueJS.
When I am trying to build using npm run buid it is throwing errors as shown
ERROR Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! e_cell_frontend#0.1.0 build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the e_cell_frontend#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! /home/vagrant/.npm/_logs/2021-08-05T04_54_44_578Z-debug.log
The log file is as shown:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ]
2 info using npm#6.14.4
3 info using node#v10.19.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle e_cell_frontend#0.1.0~prebuild: e_cell_frontend#0.1.0
6 info lifecycle e_cell_frontend#0.1.0~build: e_cell_frontend#0.1.0
7 verbose lifecycle e_cell_frontend#0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle e_cell_frontend#0.1.0~build: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/vagrant/VueJS/e_cell_frontend/node_modules/.bin:/home/vagrant/.vscode-server/bin/c3f126316369cd610563c75b1b1725e0679adfb3/bin:/home/vagrant/.local/bin:/home/vagrant/.vscode-server/bin/c3f126316369cd610563c75b1b1725e0679adfb3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle e_cell_frontend#0.1.0~build: CWD: /home/vagrant/VueJS/e_cell_frontend
10 silly lifecycle e_cell_frontend#0.1.0~build: Args: [ '-c', 'vue-cli-service build' ]
11 silly lifecycle e_cell_frontend#0.1.0~build: Returned: code: 1 signal: null
12 info lifecycle e_cell_frontend#0.1.0~build: Failed to exec build script
13 verbose stack Error: e_cell_frontend#0.1.0 build: `vue-cli-service build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid e_cell_frontend#0.1.0
15 verbose cwd /home/vagrant/VueJS/e_cell_frontend
16 verbose Linux 5.4.0-73-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
18 verbose node v10.19.0
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error e_cell_frontend#0.1.0 build: `vue-cli-service build`
22 error Exit status 1
23 error Failed at the e_cell_frontend#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 ]
I tried to clear the cache, delete node_modules and reinstalling them but there is no use. Can any one help me solving this problem.
I solved the problem. The thing is you need to remember that you need to run npm run serve first to check is there any errors in the code and then build it. I had a typo and forgot execute npm run serve so I am unaware of original errors. So run npm run server if all is good. The build it.
Related
I have a gatsby portfolio page that's simply all in an index.js file.
I am having trouble deploying it on AWS Amplify, here are the build logs:
# Starting phase: preBuild
# Executing command: npm install
2021-11-02T07:59:54.079Z [INFO]: > msgpackr-extract#1.0.15 install /codebuild/output/src648320162/src/simonshampoo.io/node_modules/msgpackr-extract
> node-gyp-build
2021-11-02T07:59:54.283Z [INFO]: > lmdb-store#1.6.11 install /codebuild/output/src648320162/src/simonshampoo.io/node_modules/lmdb-store
> node-gyp-build
2021-11-02T07:59:54.534Z [INFO]: > core-js#3.18.3 postinstall /codebuild/output/src648320162/src/simonshampoo.io/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
2021-11-02T07:59:54.582Z [INFO]: [96mThank you for using core-js ([94m https://github.com/zloirock/core-js [96m) for polyfilling JavaScript standard library![0m
[96mThe project needs your help! Please consider supporting of core-js:[0m
[96m>[94m https://opencollective.com/core-js [0m
[96m>[94m https://patreon.com/zloirock [0m
[96m>[94m https://paypal.me/zloirock [0m
[96m>[94m bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz [0m
[96mAlso, the author of core-js ([94m https://github.com/zloirock [96m) is looking for a good job -)[0m
2021-11-02T07:59:54.588Z [INFO]: > core-js-pure#3.18.3 postinstall /codebuild/output/src648320162/src/simonshampoo.io/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"
2021-11-02T07:59:54.942Z [INFO]: > gatsby-telemetry#3.0.0 postinstall /codebuild/output/src648320162/src/simonshampoo.io/node_modules/gatsby-telemetry
> node src/postinstall.js || true
2021-11-02T07:59:55.003Z [INFO]: > gatsby-cli#4.0.0 postinstall /codebuild/output/src648320162/src/simonshampoo.io/node_modules/gatsby-cli
> node scripts/postinstall.js
2021-11-02T07:59:55.057Z [INFO]: > gatsby#4.0.1 postinstall /codebuild/output/src648320162/src/simonshampoo.io/node_modules/gatsby
> node scripts/postinstall.js
2021-11-02T07:59:56.402Z [WARNING]: npm
2021-11-02T07:59:56.403Z [WARNING]: WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.3.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
2021-11-02T07:59:56.407Z [INFO]: added 1667 packages from 742 contributors and audited 1668 packages in 46.524s
2021-11-02T07:59:57.367Z [INFO]: 290 packages are looking for funding
run `npm fund` for details
2021-11-02T07:59:57.369Z [INFO]: found 17 vulnerabilities (7 moderate, 9 high, 1 critical)
run `npm audit fix` to fix them, or `npm audit` for details
2021-11-02T07:59:57.437Z [INFO]: # Completed phase: preBuild
# Starting phase: build
# Executing command: npm run build
2021-11-02T07:59:57.634Z [INFO]: > new-portfolio#1.0.0 build /codebuild/output/src648320162/src/simonshampoo.io
> gatsby build
2021-11-02T07:59:58.185Z [WARNING]: error Gatsby requires Node.js 14.15.0 or higher (you have v12.21.0).
Upgrade Node to the latest stable release: https://gatsby.dev/upgrading-node-js
2021-11-02T07:59:58.502Z [WARNING]: npm
2021-11-02T07:59:58.502Z [WARNING]: ERR! code ELIFECYCLE
npm ERR! errno 1
2021-11-02T07:59:58.504Z [WARNING]: npm
2021-11-02T07:59:58.505Z [WARNING]: ERR! new-portfolio#1.0.0 build: `gatsby build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the new-portfolio#1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-11-02T07:59:58.509Z [WARNING]:
2021-11-02T07:59:58.510Z [WARNING]: npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-11-02T07_59_58_505Z-debug.log
2021-11-02T07:59:58.510Z [HELP]: Outputting the npm debug log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/root/.nvm/versions/node/v12.21.0/bin/node',
1 verbose cli '/root/.nvm/versions/node/v12.21.0/bin/npm',
1 verbose cli 'run',
1 verbose cli 'build'
1 verbose cli ]
2 info using npm#6.14.11
3 info using node#v12.21.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle new-portfolio#1.0.0~prebuild: new-portfolio#1.0.0
6 info lifecycle new-portfolio#1.0.0~build: new-portfolio#1.0.0
7 verbose lifecycle new-portfolio#1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle new-portfolio#1.0.0~build: PATH: /root/.nvm/versions/node/v12.21.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/codebuild/output/src648320162/src/simonshampoo.io/node_modules/.bin:/usr/local/rvm/gems/ruby-2.4.6/bin:/usr/local/rvm/gems/ruby-2.4.6#global/bin:/usr/local/rvm/rubies/ruby-2.4.6/bin:/usr/local/rvm/bin:/root/.yarn/bin:/root/.config/yarn/global/node_modules/.bin:/root/.nvm/versions/node/v12.21.0/bin:/root/.local/bin:/root/.local/bin:/usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.dotnet/tools
9 verbose lifecycle new-portfolio#1.0.0~build: CWD: /codebuild/output/src648320162/src/simonshampoo.io
10 silly lifecycle new-portfolio#1.0.0~build: Args: [ '-c', 'gatsby build' ]
11 silly lifecycle new-portfolio#1.0.0~build: Returned: code: 1 signal: null
12 info lifecycle new-portfolio#1.0.0~build: Failed to exec build script
13 verbose stack Error: new-portfolio#1.0.0 build: `gatsby build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/root/.nvm/versions/node/v12.21.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:314:20)
13 verbose stack at ChildProcess.<anonymous> (/root/.nvm/versions/node/v12.21.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:314:20)
13 verbose stack at maybeClose (internal/child_process.js:1022:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
14 verbose pkgid new-portfolio#1.0.0
15 verbose cwd /codebuild/output/src648320162/src/simonshampoo.io
16 verbose Linux 4.14.248-189.473.amzn2.x86_64
17 verbose argv "/root/.nvm/versions/node/v12.21.0/bin/node" "/root/.nvm/versions/node/v12.21.0/bin/npm" "run" "build"
18 verbose node v12.21.0
19 verbose npm v6.14.11
20 error code ELIFECYCLE
21 error errno 1
22 error new-portfolio#1.0.0 build: `gatsby build`
22 error Exit status 1
23 error Failed at the new-portfolio#1.0.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 ]
2021-11-02T07:59:58.513Z [ERROR]: !!! Build failed
2021-11-02T07:59:58.513Z [ERROR]: !!! Non-Zero Exit Code detected
2021-11-02T07:59:58.513Z [INFO]: # Starting environment caching...
2021-11-02T07:59:58.513Z [INFO]: # Environment caching completed
Terminating logging...
It says that my node is outdated, but I do node -v in the project directory and it says I have v14.8.1, so I am confused. Is there another problem? public subdirectory was previously gitignored, so I removed it from there, but that doesn't seem to do anything. I can't find much information about deployment failures on Amplify since it's supposed to be straightforward. Do I have to use nvm? It also won't even deploy on Github pages-- it just shows the "Gatsby Minimal Starter" page in my repo.
I think there's a mismatching Node version between your local environment and the AWS Amplify's. If you run different versions of Node, the installed dependencies in the npm install will be different so your application will behave differently in both environments, assuming that it builds locally (if don't, there might be another underlying problem).
As you pointed, you can use nvm to set the provision version. Based on How to change Node Version in Provision Step in Amplify Console you can try:
frontend:
phases:
preBuild:
commands:
- nvm install your_local_node_version
Using a .nvmrc file in the root of the project should also work. You can set it directly by:
node -v > .nvmrc
Out of the scope of the question: /public directory should be always ignored because it's autogenerated in each build, so it will be overridden. There's no point in pushing it and it will save you MB bandwidth.
mygame#4.1.0 start /usr/src/app
node server.js
Error: Cannot find module '#adonisjs/bodyparser/providers/BodyParserProvider'
Require stack:
/usr/src/app/node_modules/require-stack/src/index.js
/usr/src/app/node_modules/require-stack/index.js
/usr/src/app/node_modules/#adonisjs/fold/src/Ioc/index.js
/usr/src/app/node_modules/#adonisjs/fold/index.js
/usr/src/app/server.js
1 requireStack
/usr/src/app/node_modules/require-stack/src/index.js:44
2 anonymous
/usr/src/app/node_modules/#adonisjs/fold/src/Registrar/index.js:104
3 arrayMap
/usr/src/app/node_modules/lodash/lodash.js:653
4 Function.map
/usr/src/app/node_modules/lodash/lodash.js:9622
5 interceptor
/usr/src/app/node_modules/lodash/lodash.js:17094
6 thru
/usr/src/app/node_modules/lodash/lodash.js:8859
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mygame#4.1.0 start: node server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mygame#4.1.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! /home/node/.npm/_logs/2021-03-25T00_06_01_885Z-debug.log
The problem is npm is installing the wrong version from body-parser, due to a recent push.
As a workaround:
go to package.json
you can replace the ^ with ~
"#adonisjs/bodyparser": "~2.0.9",
Since we prefixed the version with ~, NPM retrieved the latest patch version under the 2.0.9 minor version, which turned out to be 2.0.9 itself
For more info: https://github.com/adonisjs/bodyparser/issues/43
I began to learn ember and did working app. It was working well. Then I had to change my hard disk to ssd by cloning my old disk/ After cloning i restore my ember app from bup and tried to start it. And got error.
C:\inetpub\tracker> npm start
> tracker#0.0.0 start C:\inetpub\tracker
> ember serve
The "id" argument must be of type string. Received undefined
Stack Trace and Error Report: C:\Users\tnfoms\AppData\Local\Temp/error.dump.90e842d8b8af33fd44bc24b48197a6bd.log
An error occurred in the constructor for ember-data at C:\inetpub\tracker\node_modules\ember-data
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tracker#0.0.0 start: `ember serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the tracker#0.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! C:\Users\tnfoms\AppData\Roaming\npm-cache\_logs\2020-07-04T17_45_40_052Z-debug.log
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 'start'
1 verbose cli ]
2 info using npm#6.14.4
3 info using node#v12.18.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle tracker#0.0.0~prestart: tracker#0.0.0
6 info lifecycle tracker#0.0.0~start: tracker#0.0.0
7 verbose lifecycle tracker#0.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle tracker#0.0.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\inetpub\tracker\node_modules\.bin;C:\Python38\Scripts\;C:\Python38\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Brackets\command;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Program Files\watchman;C:\Users\tnfoms\AppData\Local\Microsoft\WindowsApps;C:\Users\tnfoms\.dotnet\tools;C:\Users\tnfoms\AppData\Local\atom\bin;C:\Users\tnfoms\AppData\Roaming\npm;C:\Users\tnfoms\AppData\Local\Programs\Git\cmd
9 verbose lifecycle tracker#0.0.0~start: CWD: C:\inetpub\tracker
10 silly lifecycle tracker#0.0.0~start: Args: [ '/d /s /c', 'ember serve' ]
11 silly lifecycle tracker#0.0.0~start: Returned: code: 1 signal: null
12 info lifecycle tracker#0.0.0~start: Failed to exec start script
13 verbose stack Error: tracker#0.0.0 start: `ember serve`
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:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid tracker#0.0.0
15 verbose cwd C:\inetpub\tracker
16 verbose Windows_NT 10.0.17763
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.18.0
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error tracker#0.0.0 start: `ember serve`
22 error Exit status 1
23 error Failed at the tracker#0.0.0 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 tried to reinstall node, ember but unsuccessfully
When in doubt
rm -rf node_modules && npm install
Sometimes npm just gets borked and you have to blow it away and start fresh
I'm trying to use mdb pro in my angular application.
So, things were working for me for the last 3 months.
Following is the line from the package.json with token replaced
"ng-uikit-pro-standard":
"git+https://oauth2:mytoken#git.mdbootstrap.com/mdb/angular/ng-uikit-pro-standard.git",
Following is the output I'm seeing now. I'm running this on aws codebuild.
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t
https://oauth2:mytoken#git.mdbootstrap.com/mdb/angular/ng-uikit-pro-standard.git
npm ERR!
npm ERR! fatal: unable to access
'https://oauth2:mytoken#git.mdbootstrap.com/mdb/angular/ng-uikit-pro-standard.git/':
server certificate verification failed. CAfile:
/etc/ssl/certs/ca-certificates.crt CRLfile: none
npm ERR!
npm ERR! exited with error code: 128
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-12-02T14_05_27_185Z-debug.log
[Container] 2018/12/02 14:05:27 Command did not exit successfully npm
install exit status 1
[Container] 2018/12/02 14:05:27 Phase complete: INSTALL Success:
false
[Container] 2018/12/02 14:05:27 Phase context status code:
COMMAND_EXECUTION_ERROR Message: Error while executing command: npm
install. Reason: exit status 1
I found out that the token generated had the expiry time.
I generated a new token and followed the instruction here to make it work.
https://mdbootstrap.com/docs/angular/getting-started/quick-start/
hopefully, it will help someone.
I've been using Zurb Foundation for Emails successfully for quite some time. Suddenly the build process is failing.
I updated to Node 7.7.2 and NPM 4.1.2, deleted the node_modules directory and ran npm install to reinstall the dependencies, but it didn't solve the issue.
$ npm run build
foundation-emails-template#1.0.0 build /Users/[REDACTED]
gulp --production
[12:46:56] Requiring external module babel-register
[12:46:57] Using gulpfile ~/[REDACTED]/gulpfile.babel.js
[12:46:57] Starting 'default'...
[12:46:57] Starting 'build'...
[12:46:57] Starting 'clean'...
[12:46:57] Finished 'clean' after 11 ms
[12:46:57] Starting 'pages'...
[12:46:59] Finished 'pages' after 1.32 s
[12:46:59] Starting 'sass'...
[12:47:05] 'sass' errored after 6.91 s
[12:47:05] Error in plugin 'gulp-uncss'
Message:
Unexpected EOF
Details:
domainEmitter: [object Object]
domain: [object Object]
domainThrown: false
[12:47:05] 'build' errored after 8.25 s
[12:47:05] 'default' errored after 8.25 s
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v7.7.2
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! foundation-emails-template#1.0.0 build: `gulp --production`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the foundation-emails-template#1.0.0 build script 'gulp --production'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the foundation-emails-template package,
npm ERR! not with npm itself.
Or if I try to run gulp --production by itself:
$ gulp --production
[12:29:38] Requiring external module babel-core/register
[12:29:39] Using gulpfile ~/[REDACTED]/gulpfile.babel.js
/usr/local/lib/node_modules/gulp/bin/gulp.js:129
gulpInst.start.apply(gulpInst, toRun);
^
TypeError: Cannot read property 'apply' of undefined
at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:19
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)
npm start works as expected; I just can't inline the styles.
Any ideas? TIA.
It's because the node environment had changed.
Run this in your console:
npm rebuild node-sass
npm rebuild gulp-uncss
It should fix the issue.
I got the same error and was caused by a code-specific issue so make sure all your code is valid. In my case I was missing a closing " on a class.