Closed SoftShit closed 4 years ago
With the introduction of https://github.com/mapbox/mapbox-gl-draw/commits/master/yarn.lock you should use yarn install
instead of npm install
to ensure you get the dependency versions set by yarn.lock
.
I opened #856 to fix the instructions.
Thank you, we use yarn, would prefer to use yarn. When installing anything, I try the published installation instructions first (npm was listed), and later try to make it work with yarn.
I ran $yarn install and got more errors. If you could publish also that Node.js version 9 is the max version supported. I don't have Node version 9 on my system, but will go download and run again now.
I got this:
$yarn install
yarn install v1.12.3
[1/4] Resolving packages...
success Already up-to-date.
$ npm run build && npm run build-min
npm WARN npm npm does not support Node.js v11.6.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
> @mapbox/mapbox-gl-draw@1.1.1 build C:\home\mpi\repos\spike\maps\mapbox\apis\gl-js\gl-draw\mapbox-gl-draw
> NODE_ENV=production browserify index.js --standalone MapboxDraw > dist/mapbox-gl-draw-unminified.js
'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @mapbox/mapbox-gl-draw@1.1.1 build: `NODE_ENV=production browserify index.js --standalone MapboxDraw > dist/mapbox-gl-draw-unminified.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @mapbox/mapbox-gl-draw@1.1.1 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:\home\user\appdata\npm-cache\_logs\2019-01-10T22_44_34_398Z-debug.log
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Your yarn install
worked, npm run build
works for me with node v8.11.2.
'NODE_ENV' is not recognized as an internal or external command,
That looks like an issue specific to Windows, looks like it doesn't understand the shell script syntax for setting an environment variable. Sorry I can't help there, I don't use Windows.
Making progress, but $yarn install is still failing. I am using a Linux env on Windows for this (bash shell)
I rolled back to Node.js 9.11.2
Environment: Windows 10 Pro, with Cygwin (bash shell). The syntax should be recognized.
got this
$yarn install
yarn install v1.12.3
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.1.1: The platform "win32" is incompatible with this module.
info "fsevents@1.1.1" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
$ npm run build && npm run build-min
> @mapbox/mapbox-gl-draw@1.1.1 build C:\home\mpi\repos\spike\maps\mapbox\apis\gl-js\gl-draw\mapbox-gl-draw
> NODE_ENV=production browserify index.js --standalone MapboxDraw > dist/mapbox-gl-draw-unminified.js
'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @mapbox/mapbox-gl-draw@1.1.1 build: `NODE_ENV=production browserify index.js --standalone MapboxDraw > dist/mapbox-gl-draw-unminified.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @mapbox/mapbox-gl-draw@1.1.1 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:\c\home\user\appdata\npm-cache\_logs\2019-01-10T22_52_49_258Z-debug.log
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
I am using cygwin on Windows, a Linux like environment that lets me run bash scripts. It should (bash) recognize the run target in package.json containing: NODE_ENV, but it is not, investigating.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Thursday, January 10, 2019 3:51 PM, Andrew Harvey notifications@github.com wrote:
Your yarn install worked, npm run build works for me with node v8.11.2.
'NODE_ENV' is not recognized as an internal or external command,
That looks like an issue specific to Windows, looks like it doesn't understand the shell script syntax for setting an environment variable. Sorry I can't help there.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
There are several ways to get around this error when running on windows:
'NODE_ENV' is not recognized as an internal or external command,
Reference:
The easiest thing to do, even if you are using Cygwin bash on windows, is to install this, and you get a little further, at least past this error message.
$yarn global add win-node-env
I am making a request to add that line to the readme.md instructions, a section : If you are running on Windows (and even if you are running a Cygwin bash shell), you will need to install this package to get this project to work:
$yarn global add win-node-env
This will save hours of time and some head banging.
To summarize:
Please update the readme.md with three things
$yarn global add win-node-env
!npm i -g npm@latest npm ERR! path C:\Users\admin'\AppData\Roaming\npm\node_modules.staging npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall unlink npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\admin'\AppData\Roaming\npm\node_modules.staging' npm ERR! { [Error: EPERM: operation not permitted, unlink 'C:\Users\admin'\AppData\Roaming\npm\node_modules.staging'] npm ERR! stack: npm ERR! 'Error: EPERM: operation not permitted, unlink \'C:\Users\admin\'\AppData\Roaming\npm\node_modules\.staging\'', npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'unlink', npm ERR! path: npm ERR! 'C:\Users\admin\'\AppData\Roaming\npm\node_modules\.staging' } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It's possible that the file was already in use (by a text editor or antivirus), npm ERR! or that you lack permissions to access it. npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\admin'\AppData\Roaming\npm-cache_logs\2019-07-20T10_24_18_554Z-debug.log
Another alternative is to switch out
NODE_ENV=production
for
SET NODE_ENV=production &&
in the package.json file. It appears to be working on Windows, if you just want to edit it locally while developing. Of course this isn't a solution though, but you don't need any third party tools for it.
Upgraded to use yarn and Node 12
I have lost a week of time trying to get this library to work. It appears to not be maintained. It fails when I do :
$npm install
I want to know why. And also why there are 26 freaking deprecation messages. This project needs a tune up.
I posted this video.
$npm install doesn't.
It spews 26 deprecation messages, and then fails. Why 26 deprecated messages? Some dependencies showing deprecated messages are Mapbox owned libraries. Please update your crap.