aframevr / aframe-inspector

:mag: Visual inspector tool for A-Frame. Hit *<ctrl> + <alt> + i* on any A-Frame scene.
https://aframe.io/aframe-inspector/examples/
MIT License
654 stars 201 forks source link

npm install raises error #628

Closed kfarr closed 2 years ago

kfarr commented 2 years ago

There is a console error when running npm install on master repo after PR https://github.com/aframevr/aframe-inspector/pull/627

ERROR in aframe-inspector.min.js from UglifyJs
Unexpected token: name (NumberWidget) [aframe-inspector.min.js:3194,6]

To get npm install to work without this error, in .babelrc line 3 change exclude to include, then run npm install again and it appears to install correctly.

However, then you must to change it back to exclude in order for the build to run and for the inspector to correctly display on localhost when running npm start

kfarr commented 2 years ago

cc @donmccurdy

donmccurdy commented 2 years ago

Hm it looks like the installation is OK, but the two build commands differ:

# succeeds
npm run dist:max

# fails
npm run dist:min

The bundled version of UglifyJS does not support ES6, and we do need ES6 for newer three.js versions. To switch to a newer minifier, I think we'd need to be on at least Webpack 3, and the project is currently at Webpack 2. So unfortunately I think this will require a handful of dependencies updates if that's OK with everyone?

donmccurdy commented 2 years ago
donmccurdy commented 2 years ago

@kfarr if you need a temporary fix here, running npm install and then npm run dist:max should work (even though npm install will print some errors. This just means you'd need to use the inspector code un-minified until #629 is in.

saurabhburadkar commented 2 years ago

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! aframe-inspector@1.2.0 build: cross-env NODE_ENV=production webpack --progress --colors npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the aframe-inspector@1.2.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! C:\Users\saurabh12\AppData\Roaming\npm-cache_logs\2021-12-22T09_54_38_495Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! aframe-inspector@1.2.0 dist:max: cross-env AFRAME_DIST=true npm run build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the aframe-inspector@1.2.0 dist:max 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\saurabh12\AppData\Roaming\npm-cache_logs\2021-12-22T09_54_38_587Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! aframe-inspector@1.2.0 dist: npm run dist:max npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the aframe-inspector@1.2.0 dist 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\saurabh12\AppData\Roaming\npm-cache_logs\2021-12-22T09_54_38_668Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! aframe-inspector@1.2.0 prepublish: npm run dist npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the aframe-inspector@1.2.0 prepublish 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:

Error is still there, please guide me how to resolve this issue

donmccurdy commented 2 years ago

@saurabhburadkar the proposed fix is https://github.com/aframevr/aframe-inspector/pull/629; it has not been merged yet. You can build from that PR locally if you need a workaround.

saurabhburadkar commented 2 years ago

thanks @donmccurdy

saurabhburadkar commented 2 years ago

still facing some error's npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! aframe-inspector@1.2.0 build: cross-env NODE_ENV=production webpack --progress --colors npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the aframe-inspector@1.2.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! C:\Users\saurabh12\AppData\Roaming\npm-cache_logs\2021-12-22T19_11_05_789Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! aframe-inspector@1.2.0 dist:max: cross-env AFRAME_DIST=true npm run build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the aframe-inspector@1.2.0 dist:max 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\saurabh12\AppData\Roaming\npm-cache_logs\2021-12-22T19_11_05_872Z-debug.log

donmccurdy commented 2 years ago

Be sure to run npm install on the branch if you haven't already. Note that the error you see means that the minified build failed, but the unminified build still worked... so you could use the unminified output instead, or minify it some other way.