Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix @babel/preset-stage-0 version #1844

Closed
wants to merge 1 commit into from
Closed

Conversation

gakada
Copy link
Contributor

@gakada gakada commented Jun 5, 2018

That is to prevent this error during npm run deploy.

@KagamiChan
Copy link
Member

KagamiChan commented Jun 5, 2018

Since this won't happen for poi's @babel/preset-stage-0@7.0.0-beta.40, how did you install dependencies?

If you use npm >= 5, it will install what the package-lock.json specifies

@KagamiChan
Copy link
Member

Anyway, this change should be made when upgrading babel. We plan to do this when we're releasing new stable version (which is blocked by memory leaking issue of Electron)

@gakada
Copy link
Contributor Author

gakada commented Jun 5, 2018

I have npm 6.1.0, so on current HEAD with

npm install
npm run deploy

it gives me that error

$ npm run deploy

> poi@9.0.0-beta.0 deploy /home/gk/github/poi/poi
> gulp deploy

/home/gk/github/poi/poi/node_modules/@babel/core/lib/config/full.js:127
    throw e;
    ^

Error: [BABEL] /home/gk/github/poi/poi/lib/utils.es: The new decorators proposal is not supported yet. You must pass the `"decoratorsLegacy": true` option to @babel/preset-stage-0 (While processing: "/home/gk/github/poi/poi/node_modules/@babel/preset-stage-0/lib/index.js")
    at _default (/home/gk/github/poi/poi/node_modules/@babel/preset-stage-0/lib/index.js:61:11)
    at /home/gk/github/poi/poi/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
    at loadDescriptor (/home/gk/github/poi/poi/node_modules/@babel/core/lib/config/full.js:157:14)
    at cachedFunction (/home/gk/github/poi/poi/node_modules/@babel/core/lib/config/caching.js:32:19)
    at loadPresetDescriptor (/home/gk/github/poi/poi/node_modules/@babel/core/lib/config/full.js:227:63)
    at config.presets.map.descriptor (/home/gk/github/poi/poi/node_modules/@babel/core/lib/config/full.js:72:19)
    at Array.map (<anonymous>)
    at recurseDescriptors (/home/gk/github/poi/poi/node_modules/@babel/core/lib/config/full.js:70:38)
    at loadFullConfig (/home/gk/github/poi/poi/node_modules/@babel/core/lib/config/full.js:100:6)
    at loadOptions (/home/gk/github/poi/poi/node_modules/@babel/core/lib/config/index.js:27:36)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! poi@9.0.0-beta.0 deploy: `gulp deploy`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the poi@9.0.0-beta.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!     /home/gk/.npm/_logs/2018-06-05T16_16_51_306Z-debug.log

@KagamiChan
Copy link
Member

Please provide the result of running npm ls @babel/preset-stage-0

@gakada
Copy link
Contributor Author

gakada commented Jun 5, 2018

Was @babel/preset-stage-0@7.0.0-beta.49, so an alternative fix is to fix its version, as package-lock.json won't always work.

@gakada gakada changed the title Enable decoratorsLegacy for @babel/preset-stage-0 Fix @babel/preset-stage-0 version Jun 5, 2018
@KagamiChan
Copy link
Member

KagamiChan commented Jun 5, 2018

If you simply run npm i as documented in readme, then npm is expected to respect the lock file, this is how package-lock.json works. Although npm used to be and is still being buggy, I'm afraid I don't see much necessity in double-fixing the version.

As I've stated before, we'll add this option when upgrading babel before finalizing the next release, not now.

@gakada
Copy link
Contributor Author

gakada commented Jun 5, 2018

Well I simply run npm i but it is installing @babel/preset-stage-0@7.0.0-beta.49, so I guess I will use that hack locally for now, in order to built it.

@gakada gakada closed this Jun 5, 2018
@gakada
Copy link
Contributor Author

gakada commented Jun 5, 2018

@KagamiChan can I make a PR for yarn maybe? It should be more well behaved.

@KagamiChan
Copy link
Member

KagamiChan commented Jun 5, 2018

@gakada I'm also using npm@6.1 but I can't reproduce your case. Even though there're many changes in package-lock.json because they changed the lock file format (again), the version locking is OK for me.

How about removing node_modules folder and run npm i again?

On yarn.lock, I don't think we could make it. It is nearly impossible to keep syncing both lock files. We chose to use npm's lock file because we use npm to install plugins and have not switched to yarn before.

@gakada
Copy link
Contributor Author

gakada commented Jun 5, 2018

My bad, I think my global npm configuration was modified, as after deleting all relevant folders and reinstalling npm it is now installing the right version.

@gakada
Copy link
Contributor Author

gakada commented Jun 5, 2018

Btw (on Linux) when it was (basically) ignoring package-lock.json (and with fixed @babel/preset-stage-0 version) node v10.3.0 / npm v6.1.0 was working, while now with fixed npm there is an error

$ nvm use 10
Now using node v10.3.0 (npm v6.1.0)
$ npm run deploy

> poi@9.0.0-beta.0 deploy /home/gk/github/poi/poi
> gulp deploy

gulp[3351]: ../src/node_contextify.cc:629:static void node::contextify::ContextifyScript::New(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `args[1]->IsString()' failed.
 1: node::Abort() [gulp]
 2: 0x880675 [gulp]
 3: node::contextify::ContextifyScript::New(v8::FunctionCallbackInfo<v8::Value> const&) [gulp]
 4: v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo*) [gulp]
 5: 0xaed88f [gulp]
 6: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [gulp]
 7: 0x15a27280427d
Aborted (core dumped)

With

$ nvm use 9
Now using node v9.11.1 (npm v5.6.0)

it is ok.

@gakada gakada deleted the babel branch June 5, 2018 18:19
@gakada
Copy link
Contributor Author

gakada commented Jun 5, 2018

Which looks like something for gulp@3.9.1 -> gulp@4.0.0 update.

@KagamiChan
Copy link
Member

This seems to be incompatibility of gulp, would you like to make a PR?

@gakada
Copy link
Contributor Author

gakada commented Jun 16, 2018

From this issue (current HEAD)

$ npm ls natives
poi@9.0.0-beta.0
├─┬ gulp@3.9.1
│ └─┬ vinyl-fs@0.3.14
│   └─┬ graceful-fs@3.0.11
│     └── natives@1.1.0 
└─┬ node-unzip-2@0.2.1
  └─┬ fstream@0.1.31
    └─┬ graceful-fs@3.0.11
      └── natives@1.1.0  deduped

then after

$ npm i gulp@3.9.1 node-unzip-2@0.2.1

it is

$ npm ls natives
poi@9.0.0-beta.0
├─┬ gulp@3.9.1
│ └─┬ vinyl-fs@0.3.14
│   └─┬ graceful-fs@3.0.11
│     └── natives@1.1.4 
└─┬ node-unzip-2@0.2.1
  └─┬ fstream@0.1.31
    └─┬ graceful-fs@3.0.11
      └── natives@1.1.4  deduped

with package-lock.json modified. So natives@1.1.4 fixed that gulp crash for me.

@KagamiChan
Copy link
Member

KagamiChan commented Jun 17, 2018

A simpler way is to delete natives in lock file and run npm i again, npm will resolve the package to latest version.

I've made #1847, which is now blocked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants