I'm trying to build my vue project and push it into github pages.
I'm trying to run npm run build but all I'm getting is this :
> my-domain#1.0.0 build /Users/macbookair/Workspace/fun/mine/web
> cross-env NODE_ENV=production webpack --progress --hide-modules
Hash: 2399923ef57865258a1f
Version: webpack 3.11.0
Time: 9252ms
Asset Size Chunks Chunk Names
build.js 740 kB 0 [emitted] [big] main
build.js.map 919 kB 0 [emitted] main
ERROR in build.js from UglifyJs
Unexpected token: punc (() [build.js:503,6]
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! andre.js.org#1.0.0 build: `cross-env NODE_ENV=production webpack --progress --hide-modules`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the andre.js.org#1.0.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/macbookair/.npm/_logs/2018-02-27T09_19_23_677Z-debug.log
I also tried to run npm run build; push-dir --dir=dist --branch=gh-pages --cleanup and all I'm getting is this :
> andre.js.org#1.0.0 build /Users/macbookair/Workspace/fun/mine/web
> cross-env NODE_ENV=production webpack --progress --hide-modules
Hash: 2399923ef57865258a1f
Version: webpack 3.11.0
Time: 9524ms
Asset Size Chunks Chunk Names
build.js 740 kB 0 [emitted] [big] main
build.js.map 919 kB 0 [emitted] main
ERROR in build.js from UglifyJs
Unexpected token: punc (() [build.js:503,6]
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! andre.js.org#1.0.0 build: `cross-env NODE_ENV=production webpack --progress --hide-modules`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the andre.js.org#1.0.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/macbookair/.npm/_logs/2018-02-27T09_22_29_715Z-debug.log
I don't really know how to build it since I'm new to Vue, I'm using the webpack-simple vue template
You can try this option:
https://github.com/creotip/vue-particles/issues/7
But maybe the better options will be reinstall npm
You use Version: webpack 3.11.0
Try to install latest version
$ npm i -D webpack#latest
$ npm run build
Related
Good morning, I am trying to make a deployment of a page developed in vue.js and I uploaded all the files and it works, I just need to run "npm run dev" but it throws me the following error. I already ran "npm install" delete package.json and the node_modules folders I ran everything from scratch again but it remains the same
> # dev /var/www/html
> npm run development
> # development /var/www/html
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js
21% building 95/96 modules 1 active .../dist/cjs.js??ref--5-5!/var/www/html/resources/sass/app.scssnpm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # development 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! /root/.npm/_logs/2021-01-08T16_00_32_214Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # dev 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! /root/.npm/_logs/2021-01-08T16_00_32_256Z-debug.log
Try to below way i hope it work
1. cmd -> npm cache clean
2. delete package.lock.json file
3. delete node module folder
4. cmd -> npm install
I'm trying to import react, I wrote the following code:
import React from "react";
but when I write npm start in the terminal it shows me these errors:
> reactjs-basics#1.0.0 start /home/zx-coder/Downloads/reactjs-basics-master
> npm run build
> reactjs-basics#1.0.0 build /home/zx-coder/Downloads/reactjs-basics-master
> webpack -d && cp src/index.html dist/index.html && webpack-dev-server --content-base src/ --inline --hot
Hash: 2692c371e3a85309b95e Version: webpack 1.15.0 Time: 1020ms
Asset Size Chunks Chunk Names
bundle.js 166 kB 0 [emitted] main bundle.js.map 184 kB 0 [emitted] main
+ 37 hidden modules events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE 127.0.0.1:8080
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at Server.setupListenHandle [as _listen2] (net.js:1367:14)
at listenInCluster (net.js:1408:12)
at GetAddrInfoReqWrap.doListen [as callback] (net.js:1517:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:97:10)
npm ERR! Linux 4.15.0-29-generic npm ERR! argv "/usr/bin/node"
"/usr/bin/npm" "run" "build" npm ERR! node v8.10.0 npm ERR! npm
v3.5.2 npm ERR! code ELIFECYCLE npm ERR! reactjs-basics#1.0.0 build:
`webpack -d &&cp src/index.html dist/index.html && webpack-dev-server
--content-base src/ --inline --hot` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the reactjs-basics#1.0.0 build script 'webpack -d
&& cp src/index.html dist/index.html && webpack-dev-server
--content-base src/ --inline --hot'. 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 reactjs-basics package, npm ERR! not
with npm itself. npm ERR! Tell the author that this fails on your
system: npm ERR! webpack -d && cp src/index.html dist/index.html
&& webpack-dev-server --content-base src/ --inline --hot npm ERR! You
can get information on how to open an issue for this project with: npm
ERR! npm bugs reactjs-basics npm ERR! Or if that isn't available,
you can get their info via: npm ERR! npm owner ls reactjs-basics
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with anysupport request:
npm ERR!
/home/zx-coder/Downloads/reactjs-basics-master/npm-debug.log
npm ERR! Linux 4.15.0-29-generic npm ERR! argv "/usr/bin/node"
"/usr/bin/npm" "start" npm ERR! node v8.10.0 npm ERR! npm v3.5.2 npm
ERR! code ELIFECYCLE npm ERR! reactjs-basics#1.0.0 start: `npm run
build` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the
reactjs-basics#1.0.0 start script 'npm run build'. 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 reactjs-basics package,
npm ERR! not with npm itself. npm ERR! Tell the author that this fails
on your system: npm ERR! npm run build npm ERR! You can get
information on how to open an issue for this project with: npm ERR!
npm bugs reactjs-basics npm ERR! Or if that isn't available, you can
get their info via: npm ERR! npm owner ls reactjs-basics npm ERR!
There is likely additional logging output above.
npm ERR! Please include the following file with anysupport request:
npm ERR!
/home/zx-coder/Downloads/reactjs-basics-master/npm-debug.log
The error is Error: listen EADDRINUSE 127.0.0.1:8080 which means there already is something that uses port 8080 on your machine, try changing the port webpack starts the dev server
solution 1: if your are beginner - just restart your PC.
solution 2: open task manager and kill all node instances.
alternatively you check if there is some other react app already running on port 8080 so you have to stop it
OR
you have to change your current app port to some other port.
Miks#DESKTOP-DOAIF41 MINGW64 ~/Desktop/LYNDA MERN/Exercise Files/Ch02/02_01/start/dist
$ npm start
react-essential#1.0.0 start c:\Users\mctumbaga\Desktop\LYNDA MERN\Exercise Files\Ch02\02_01\start
httpster -d ./dist -p 3000
'httpster' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-essential#1.0.0 start: httpster -d ./dist -p 3000
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-essential#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\mctumbaga\AppData\Roaming\npm-cache_logs\2018-10-18T02_15_26_741Z-debug.log
I see above that your error states:
'httpster' is not recognized as an internal or external command, operable program or batch file.
Have you tried installing the package globally npm -g install httpster so that httpster is accessible from any directory where you want to have an HTTP service running?
When I run "npm install", it runs successfully and it installs all the packages in node_module folder. However when I run "npm start" command in cmd then it gives following errors.
D:\INSM-HTML-Player>npm start
insm-player#1.0.0 start D:\INSM-HTML-Player
npm run build && npm run serve | npm run watch
insm-player#1.0.0 build D:\INSM-HTML-Player
rollup -c && concat-cli -f dist/main.js -o dist/all.js && npm run compress
resolve failed: { Error: Cannot find module 'npm-watch'
at Function.Module._resolveFilename (module.js:469:15)
at Function.requireRelative.resolve (D:\INSM-HTML-Player\node_modules\requir e-relative\index.js:30:17)
at resolve (D:\INSM-HTML-Player\node_modules\modify-babel-preset\lib\seriali ze.js:25:26)
at findAndRemove (D:\INSM-HTML-Player\node_modules\modify-babel-preset\lib\s erialize.js:67:11)
at D:\INSM-HTML-Player\node_modules\modify-babel-preset\lib\serialize.js:111:13 at Array.map (native)
at loadPreset (D:\INSM-HTML-Player\node_modules\modify-babel-preset\lib\serialize.js:103:29)
at module.exports (D:\INSM-HTML-Player\node_modules\modify-babel-preset\inde x.js:97:19)
at Object.<anonymous> (D:\INSM-HTML-Player\node_modules\babel-preset-es2015-rollup\index.js:3:18)
at Module._compile (module.js:570:32) code: 'MODULE_NOT_FOUND' } npm-watch resolve failed: { Error: Cannot find module 'grunt-cli'
at Function.Module._resolveFilename (module.js:469:15)
at Function.requireRelative.resolve (D:\INSM-HTML-Player\node_modules\requir e-relative\index.js:30:17)
at resolve (D:\INSM-HTML-Player\node_modules\modify-babel-preset\lib\seriali ze.js:25: at findAndRemove (D:\INSM-HTML-Player\node_modules\modify-babel-preset\lib\s erialize.js:67:11)
at D:\INSM-HTML-Player\node_modules\modify-babel-preset\lib\serialize.js:111:13
at Array.map (native)
at loadPreset (D:\INSM-HTML-Player\node_modules\modify-babel-preset\lib\serialize.js:103:29)
at module.exports (D:\INSM-HTML-Player\node_modules\modify-babel-preset\index.js:97:19)
at Object.<anonymous> (D:\INSM-HTML-Player\node_modules\babel-preset-es2015-rollup\index.js:3:18)
at Module._compile (module.js:570:32) code: 'MODULE_NOT_FOUND' } gruntcli C:\Program Files\nodejs\node.exe D:\INSM-HTML-Player\node_modules\rollup\bin\rollup concat-cli -f string -o string
Options: -f, --files files or glob/wildcard to be matched and concatenated
[array] [required]
-o, --output the resulting file of the concatenation[string] [default: "all"]
--helpShow help [boolean]Examples: concat-cli -f *.js -o bundle.js This will concatenate all the js files in the current directory into a bundle.js Missing required argument: f
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe""C:\\ProgramFiles\\nodejs\\node_modules\\npm\\bin\\npm cli.js" "run" "build"
npm ERR! node v6.9.4
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! insm-player#1.0.0 build: `rollup -c && concat-cli -f dist/main.js o dist/all.js && npm run compress`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the insm-player#1.0.0 build script 'rollup -c && concat cli - f dist/main.js -o dist/all.js && npm run compress'.
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 insm-player package,
npm ERR! not with npm itself. npm ERR! Tell
the author that this fails on your system:
npm ERR! rollup -c &&
concat-cli -f dist/main.js -o dist/all.js && npm run c ompress npm
ERR! You can get information on how to open an issue for this project
with:
npm ERR! npm bugs insm-player npm ERR! Or if that isn't
available, you can get their info via: npm ERR! npm owner ls
insm-player
npm ERR! There is likely additional logging output
above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\INSM-HTML-Player\npm-debug.log
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\ node_modules\\npm\\bin\\npm-cli.js" "start" npm
ERR! node v6.9.4 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE
npm ERR! insm-player#1.0.0 start: `npm run build && npm run serve |
npm run watch`
npm ERR! Exit status 1 npm ERR! npm ERR! Failed
at the insm-player#1.0.0 start script 'npm run build && npm run
serve | npm run watch'.
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 insm-player package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run build && npm run serve | npm run watch
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs insm-player
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls insm-player
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\INSM-HTML-Player\npm-debug.log
You have to add the missing package npm-watch to package.json:
npm install npm-watch --save-dev
The run npm start again.
I'm trying to reference logary-js (DISCLAIMER: my own project) from a project of mine.
I have this packages.json file:
...
"dependencies": {
"logary": "logary/logary-js#master",
...
}
...
However, when trying to pull down the package, it fails with this error:
✗ npm install
> logary#1.0.0 preinstall /Users/h/dev/proj/node_modules/.staging/logary-6603d70a
> npm run build
> logary#1.0.0 build /Users/h/dev/proj/node_modules/.staging/logary-6603d70a
> NODE_ENV=production webpack --progress --color --display-error-details --display-reasons --optimize-minimize
webpack 1.12.14
Usage: https://webpack.github.io/docs/cli.html
Options:
--help, -h, -?
--config
--context
--entry
--module-bind
--module-bind-post
--module-bind-pre
--output-path
--output-file
--output-chunk-file
--output-named-chunk-file
--output-source-map-file
--output-public-path
--output-jsonp-function
--output-pathinfo
--output-library
--output-library-target
--records-input-path
--records-output-path
--records-path
--define
--target
--cache [default: true]
--watch, -w
--watch which closes when stdin ends
--watch-aggregate-timeout
--watch-poll
--hot
--debug
--devtool
--progress
--resolve-alias
--resolve-loader-alias
--optimize-max-chunks
--optimize-min-chunk-size
--optimize-minimize
--optimize-occurence-order
--optimize-dedupe
--prefetch
--provide
--labeled-modules
--plugin
--bail
--profile
-d shortcut for --debug --devtool sourcemap --output-pathinfo
-p shortcut for --optimize-minimize
--json, -j
--colors, -c
--sort-modules-by
--sort-chunks-by
--sort-assets-by
--hide-modules
--display-exclude
--display-modules
--display-chunks
--display-error-details
--display-origins
--display-cached
--display-cached-assets
--display-reasons, --verbose, -v
Output filename not configured.
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/h/.nvm/versions/node/v5.6.0/bin/node" "/Users/h/.nvm/versions/node/v5.6.0/bin/npm" "run" "build"
npm ERR! node v5.6.0
npm ERR! npm v3.6.0
npm ERR! code ELIFECYCLE
npm ERR! logary#1.0.0 build: `NODE_ENV=production webpack --progress --color --display-error-details --display-reasons --optimize-minimize`
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the logary#1.0.0 build script 'NODE_ENV=production webpack --progress --color --display-error-details --display-reasons --optimize-minimize'.
Which is an error you get if there's no webpack.config.js file in the directory. This makes me believe that npm is only pulling down a few files. npm-debug.log says:
89 verbose tar unpack /Users/h/.npm/logary/1.0.0/package.tgz
90 verbose tar unpacking to /Users/h/dev/proj/node_modules/.staging/logary-6603d70a
91 silly gentlyRm /Users/h/dev/proj/node_modules/.staging/logary-6603d70a is being purged
92 verbose gentlyRm don't care about contents; nuking /Users/h/dev/proj/node_modules/.staging/logary
-6603d70a
93 silly gunzTarPerm modes [ '770', '660' ]
94 silly gunzTarPerm extractEntry package.json
95 silly gunzTarPerm extractEntry README.md
96 silly gunzTarPerm extractEntry LICENSE
97 silly gentlyRm /Users/h/dev/proj/node_modules/.staging/logary-6603d70a/node_modules is being purg
ed
98 verbose gentlyRm don't care about contents; nuking /Users/h/dev/proj/node_modules/.staging/logary
-6603d70a/node_modules
99 silly doParallel preinstall 1
100 silly preinstall logary#1.0.0 /Users/h/dev/proj/node_modules/.staging/logary-6603d70a
101 info lifecycle logary#1.0.0~preinstall: logary#1.0.0
Also, in this example https://github.com/logary/logary-js/tree/master/examples/webpack it's referencing logary just fine, albeit through the file system rather than github.
So the question becomes; how do I reference logary from github? Or what should I change in its package.json file to make it work?
You can install a Node package from GitHub using the syntax npm install --save https://github.com/{USER}/{REPO}/tarball/{BRANCH}. You could also check this answer, it has great tips about this.