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

Installing Storybook 2.35.3 results in babel deprecation warning #756

Closed
kaiyoma opened this issue Apr 11, 2017 · 28 comments
Closed

Installing Storybook 2.35.3 results in babel deprecation warning #756

kaiyoma opened this issue Apr 11, 2017 · 28 comments

Comments

@kaiyoma
Copy link

kaiyoma commented Apr 11, 2017

Here are the relevant portions of my package.json:

  "dependencies": {
    "babel-plugin-transform-runtime": "~6.23.0",
    "babel-polyfill": "~6.23.0",
    "classnames": "~2.2.3",
    "react-icons": "~2.2.3",
    "react-pure-render": "~1.0.2"
  },
  "devDependencies": {
    "@kadira/storybook": "~2.35.3",
    "babel-cli": "~6.24.1",
    "babel-core": "~6.24.1",
    "babel-eslint": "~7.2.1",
    "babel-preset-es2015": "~6.24.1",
    "babel-preset-react": "~6.24.1",
    "babel-preset-stage-0": "~6.24.1",
    "chai": "~3.5.0",
    "chai-enzyme": "~0.6.1",
    "css-loader": "~0.28.0",
    "enzyme": "~2.8.0",
    "eslint": "~2.10.2",
    "eslint-config-arista": "0.0.1",
    "file-loader": "~0.11.1",
    "jsdom": "~9.12.0",
    "less": "~2.7.2",
    "less-loader": "~4.0.3",
    "lesshint": "~3.1.1",
    "mocha": "~3.2.0",
    "mocha-jenkins-reporter": "~0.3.7",
    "react": "~15.4.2",
    "react-addons-test-utils": "~15.4.2",
    "react-dom": "~15.4.2",
    "sinon": "~2.1.0",
    "style-loader": "~0.16.1",
    "url-loader": "~0.5.7",
    "webpack": "~2.3.3"
  }

If I blow away node_modules and perform a clean npm install, I get this warning:

npm WARN deprecated babel-preset-latest@6.16.0: 💥  preset-latest accomplishes the same task as babel-preset-env. 🙏  Please install it with 'npm install babel-preset-env --save-dev'. '{ "presets": ["latest"] }' to '{ "presets": ["env"] }'. For more info, please check the docs: http://babeljs.io/docs/plugins/preset-env 👌. And let us know how you're liking Babel at @babeljs on 🐦

I'm not installing babel-preset-latest or babel-preset-env directly; they're both coming from Storybook. Please let me know if you need any more info.

@ndelangen
Copy link
Member

Thanks for the report!

@ndelangen ndelangen added this to the v3.0.0 milestone Apr 12, 2017
@ndelangen ndelangen self-assigned this Apr 27, 2017
@ndelangen
Copy link
Member

I've worked on moving devDependencies to the root today, mostly babel. So Will need to check if this is still something that happens. I'm not getting any error-messages like this.

@ndelangen
Copy link
Member

If someone could check if this still happens and if so when, that'd be a great help!

@kaiyoma
Copy link
Author

kaiyoma commented Apr 27, 2017

I'm happy to help out, but I don't see any releases after 2.35.3, which is the version I'm installing that exhibits this issue. (I also don't see any commits to this issue.)

@ndelangen
Copy link
Member

Hey thanks @kaiyoma !

We recently moved to a monorepo structure managed by lerna.
What you can do to help is reproduce the issue like this:

  • Clone the repo
  • perform an npm install (this should bootstrap lerna)
    If it fails initially, retry it by running npm install again. (I'm working on that issue).
    It should roughly look like this:
    ➜  react-storybook git:(master) yarn
    yarn install v0.22.0
    [1/4] 🔍  Resolving packages...
    success Already up-to-date.
    $ lerna bootstrap --hoist
    Lerna v2.0.0-rc.3
    Encountered a cycle in the dependency graph. This may cause instability!
    Bootstrapping 19 packages
    Preinstalling packages
    Installing external dependencies
    Symlinking packages and binaries
    Postinstalling packages
    Prepublishing packages
    Successfully bootstrapped 19 packages.
    ✨  Done in 62.68s.
    
  • Go to /examples/test-cra/
  • Make whatever changes to need to to reproduce the problem.
  • Share how you reproduced the problem, if simple by a message, if complex a branch I can look at is preferred

Thanks so much! Let me know if you need help.

@kaiyoma
Copy link
Author

kaiyoma commented Apr 28, 2017

I can't repro the issue by cloning the repo and installing. To repro the issue, you have to install storybook from inside another project. You can do so with this barebones config:

package.json:

{
  "name": "test",
  "devDependencies": {
    "@kadira/storybook": "2.35.3",
    "react": "15.0.0",
    "react-dom": "15.0.0"
  }
}

.npmrc:

@kadira:registry=https://registry.npmjs.org/

When you npm install, the first line of output will be the babel warning.

@ndelangen
Copy link
Member

Right so that will install an older version, I'd love to know if what's on master still exhibits this behavior..

@kaiyoma
Copy link
Author

kaiyoma commented Apr 28, 2017

I wonder if that requires some npm link magic? I'm not familiar with that process, so if you have some steps to follow, let me know.

tmeasday pushed a commit that referenced this issue May 1, 2017
See #756 (comment)

We should actually ensure this works consistently for people before making this change.
@diegohaz
Copy link

diegohaz commented May 1, 2017

I'm seeing this warning related to babel-preset-react-app:
image

@ndelangen
Copy link
Member

Looks like we're using babel-preset-latest somewhere we should be using babel-preset-env

@ndelangen
Copy link
Member

ndelangen commented May 10, 2017

@diegohaz Do you think you could try it with this branch? #1008

@ndelangen
Copy link
Member

@kaiyoma We now have some steps described here: https://github.com/storybooks/storybook/blob/master/CONTRIBUTING.md#testing-against-master

I hope this helps you reproduce the issue.

@kaiyoma
Copy link
Author

kaiyoma commented May 10, 2017

I'm getting an error when running npm install inside storybook:

$ npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\Node.js\\node.exe" "C:\\Program Files\\Node.js\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.9
npm ERR! code E404

npm ERR! 404 no such package available : @types/react
npm ERR! 404
npm ERR! 404  '@types/react' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'jest-enzyme'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

@ndelangen
Copy link
Member

@kaiyoma
Copy link
Author

kaiyoma commented May 10, 2017

In my team's project, we need an entry in our .npmrc to be able to install Storybook:

@kadira:registry=https://registry.npmjs.org/

Maybe you need the same thing in your source tree?

@ndelangen
Copy link
Member

Looking at your log, It's clear the package it's failing to install is a dependency of 'jest-enzyme'.
I'm guessing you need to map:

@types:registry=https://registry.npmjs.org/

I have no idea why this would be necessary, your node & npm versions seem fine to me.

@kaiyoma
Copy link
Author

kaiyoma commented May 11, 2017

Adding .npmrc with the line above fixed the install issue. I'm guessing you guys need to add that file as part of your project?

In the interest of full helpfulness, I noticed a few (probably benign) warnings during the installation:

npm WARN deprecated fs-promise@2.0.3: Use mz or fs-extra^3.0 with Promise Support
...
npm WARN storybook@ No repository field.
npm WARN storybook@ No license field.

During npm run bootstrap, I encountered resolution errors similar to the ones we saw before:

lerna ERR! execute npm ERR! 404 no such package available : @kadira/storybook-addon-links

However, this time, adding a line to .npmrc does not fix the issue. Here's my .npmrc now:

@kadira:registry=https://registry.npmjs.org/
@types:registry=https://registry.npmjs.org/

And here's what happens when I try npm run bootstrap:

lerna ERR! execute Error: Command failed: npm install
lerna ERR! execute npm ERR! Windows_NT 10.0.15063
lerna ERR! execute npm ERR! argv "C:\\Program Files\\Node.js\\node.exe" "C:\\Program Files\\Node.js\\node_modules\\npm\\bin\\npm-cli.js" "install"
lerna ERR! execute npm ERR! node v6.9.1
lerna ERR! execute npm ERR! npm  v3.10.9
lerna ERR! execute npm ERR! code E404
lerna ERR! execute
lerna ERR! execute npm ERR! 404 no such package available : @kadira/storybook-addon-links
lerna ERR! execute npm ERR! 404
lerna ERR! execute npm ERR! 404  '@kadira/storybook-addon-links' is not in the npm registry.
lerna ERR! execute npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
lerna ERR! execute npm ERR! 404
lerna ERR! execute npm ERR! 404 Note that you can also install from a
lerna ERR! execute npm ERR! 404 tarball, folder, http url, or git url.

That error repeats about 4 times and I also see this:

npm ERR! 404 no such package available : @kadira/storybook-deployer

Any ideas?

(BTW, how come you guys require the @kadira at all? I haven't seen that with any of the other dozens of NPM packages that we use.)

@ndelangen
Copy link
Member

Hey @kaiyoma, I'm at a loss..

The .npmrc stuff you apparently need to do is not normal, It's not something everyone needs to do because https://registry.npmjs.org/ is the default registry of npm.
I have no idea why you have to add all organisations to your .npmrc file like that.


I'm aware of this one:

npm WARN deprecated fs-promise@2.0.3: Use mz or fs-extra^3.0 with Promise Support

But these are unknown to me:

npm WARN storybook@ No repository field.

We're migrating away from the @kadira organisation to a @storybook organisation on npm. But this is still in progress.

@kaiyoma
Copy link
Author

kaiyoma commented May 11, 2017

We have an internal NPM registry here at my organization. Would that explain things?

@ndelangen
Copy link
Member

ndelangen commented May 11, 2017

Yeah that would have to be it! Maybe you you can ask for support there.

At my current client (unrelated to storybook), we're using artifactory as a custom registry, and it's able to pass though to the regular registry (including organisations) just fine.

@kaiyoma
Copy link
Author

kaiyoma commented May 11, 2017

Our internal repository does the same thing actually. I'm wondering if the lerna layer requires more configuration to resolve all the names. In any case, I'll try testing master on my personal laptop later, which will be much easier than wrangling with my work environment.

@kaiyoma
Copy link
Author

kaiyoma commented May 12, 2017

I'm running into issues on my personal laptop as well. I believe I made it past the name resolution part and I'm now seeing an error relating to a missing directory:

$ npm run bootstrap

> storybook@ bootstrap C:\Users\Kyle\Downloads\storybook
> lerna bootstrap

lerna info version 2.0.0-rc.4
lerna info ignore [ 'test-cra' ]
lerna WARN ECYCLE Encountered a cycle in the dependency graph. This may cause instability!
lerna info Bootstrapping 18 packages
lerna info lifecycle preinstall
lerna info Installing external dependencies
lerna info Symlinking packages and binaries
lerna ERR! execute Error: ENOENT: no such file or directory, stat 'C:\Users\Kyle\Downloads\storybook\packages\react-storybook\dist\server\build.js'
lerna ERR! execute     at Error (native)
lerna ERR! execute  callback with error
lerna ERR! execute  { Error: ENOENT: no such file or directory, stat 'C:\Users\Kyle\Downloads\storybook\packages\react-storybook\dist\server\build.js'
lerna ERR! execute     at Error (native)
lerna ERR! execute   errno: -4058,
lerna ERR! execute   code: 'ENOENT',
lerna ERR! execute   syscall: 'stat',
lerna ERR! execute   path: 'C:\\Users\\Kyle\\Downloads\\storybook\\packages\\react-storybook\\dist\\server\\build.js' }

I looked at the directory structure manually and I can verify that there is definitely no dist directory underneath storybook/packages/react-storybook:

$ ll packages/react-storybook/
total 306
-rw-r--r-- 1 Kyle 197121   218 May 11 20:10 addons.js
-rw-r--r-- 1 Kyle 197121 28663 May 11 20:10 CHANGELOG.md
-rw-r--r-- 1 Kyle 197121  3225 May 11 20:10 CODE_OF_CONDUCT.md
drwxr-xr-x 1 Kyle 197121     0 May 11 20:10 config/
drwxr-xr-x 1 Kyle 197121     0 May 11 20:10 demo/
drwxr-xr-x 1 Kyle 197121     0 May 11 20:10 docs/
-rw-r--r-- 1 Kyle 197121  1096 May 11 20:10 LICENSE
drwxr-xr-x 1 Kyle 197121     0 May 11 20:22 node_modules/
-rw-r--r-- 1 Kyle 197121  2301 May 11 20:10 package.json
-rw-r--r-- 1 Kyle 197121  1830 May 11 20:10 README.md
-rw-r--r-- 1 Kyle 197121   290 May 11 20:10 ROADMAP.md
drwxr-xr-x 1 Kyle 197121     0 May 11 20:10 scripts/
drwxr-xr-x 1 Kyle 197121     0 May 11 20:10 src/

@ndelangen ndelangen modified the milestones: v3.0.1, v3.0.0 May 17, 2017
@ndelangen
Copy link
Member

This will be a known issue in the 3.0.0-alpha.0 release

@mbarragana
Copy link

It seems that babel-preset-react-app is still using babel-preset-latest, but I could not find it

@ndelangen
Copy link
Member

When I do a clean CRA install and then add storybook via cli, I do not get this message anymore.

ndelangen pushed a commit that referenced this issue May 24, 2017
See #756 (comment)

We should actually ensure this works consistently for people before making this change.
@AkanWealth
Copy link

npm ERR! code E404
npm ERR! 404 Not Found: bable-preset-env@latest
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HP PC\AppData\Roaming\npm-cache_logs\2018-06-30T08_40_00_824Z-debug.log
how do i install babel-cli babel-preset-env

@kaiyoma
Copy link
Author

kaiyoma commented Jun 30, 2018

Did you copy that output exactly? Because you have a typo here:

npm ERR! 404 Not Found: bable-preset-env@latest

That should be babel-preset-env.

@AkanWealth
Copy link

thanks for that i will rerun it

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

No branches or pull requests

5 participants