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

[error] vue-cli-service build --target lib --name mylib /to/my/path/index.ts #5083

Closed
Kaifuny opened this issue Jan 15, 2020 · 2 comments
Closed

Comments

@Kaifuny
Copy link

Kaifuny commented Jan 15, 2020

Version

4.1.2

Environment info

 System:
    OS: macOS 10.15.2
    CPU: (8) x64 Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz
  Binaries:
    Node: 13.0.1 - ~/.nvm/versions/node/v13.0.1/bin/node
    Yarn: 1.19.1 - ~/.nvm/versions/node/v13.0.1/bin/yarn
    npm: 6.13.2 - ~/.nvm/versions/node/v13.0.1/bin/npm
  Browsers:
    Chrome: 79.0.3945.117
    Firefox: Not Found
    Safari: 13.0.4
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0
    @vue/babel-plugin-transform-vue-jsx:  1.1.2
    @vue/babel-preset-app:  4.1.2
    @vue/babel-preset-jsx:  1.1.2
    @vue/babel-sugar-functional-vue:  1.1.2
    @vue/babel-sugar-inject-h:  1.1.2
    @vue/babel-sugar-v-model:  1.1.2
    @vue/babel-sugar-v-on:  1.1.2
    @vue/cli-overlay:  4.1.2
    @vue/cli-plugin-babel: ^4.1.0 => 4.1.2
    @vue/cli-plugin-router: ^4.1.0 => 4.1.2
    @vue/cli-plugin-typescript: ^4.1.0 => 4.1.2
    @vue/cli-plugin-unit-jest: ^4.1.0 => 4.1.2
    @vue/cli-plugin-vuex: ^4.1.0 => 4.1.2
    @vue/cli-service: ^4.1.0 => 4.1.2
    @vue/cli-shared-utils:  4.1.2
    @vue/component-compiler-utils:  3.1.1
    @vue/composition-api: ^0.3.4 => 0.3.4
    @vue/preload-webpack-plugin:  1.1.1
    @vue/test-utils: 1.0.0-beta.29 => 1.0.0-beta.29
    @vue/web-component-wrapper:  1.2.0
    jest-serializer-vue:  2.0.2
    typescript: ~3.5.3 => 3.5.3
    vue: ^2.6.10 => 2.6.11
    vue-class-component: ^7.0.2 => 7.2.2
    vue-hot-reload-api:  2.3.4
    vue-jest:  3.0.5
    vue-loader:  15.8.3
    vue-property-decorator: ^8.3.0 => 8.3.0
    vue-router: ^3.1.3 => 3.1.4
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.6.10 => 2.6.11
    vue-template-es2015-compiler:  1.9.1
    vuex: ^3.1.2 => 3.1.2
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

  1. vue create myproject
  2. select typescript
  3. use command like this: vue-cli-service build --target lib --name mylib /to/my/path/index.ts

What is expected?

DONE Compiled successfully in 4881ms 12:22:03

File Size Gzipped

dist/mylib.umd.min.js 31.88 KiB 11.44 KiB
dist/mylib.umd.js 117.09 KiB 27.96 KiB
dist/mylib.common.js 116.62 KiB 27.75 KiB

What is actually happening?

ERROR Failed to compile with 1 errors 下午12:13:16

error in ./packages/index.ts

Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 1)
[BABEL] /Users/myuser/Documents/github/mylib/packages/index.ts: Package exports for '/Users/myuser/Documents/github/mylib/node_modules/@babel/helper-compilation-targets' do not define a '.' subpath (While processing: "/Users/myuser/Documents/github/mylib/node_modules/@vue/cli-plugin-babel/preset.js")

at resolveExports (internal/modules/cjs/loader.js:419:17)
at Function.Module._findPath (internal/modules/cjs/loader.js:492:20)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:787:27)
at Function.Module._load (internal/modules/cjs/loader.js:693:27)
at Module.require (internal/modules/cjs/loader.js:864:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/Users/myuser/Documents/github/mylib/node_modules/@babel/preset-env/lib/debug.js:8:33)
at Module._compile (internal/modules/cjs/loader.js:971:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1011:10)
at Module.load (internal/modules/cjs/loader.js:822:32)

@ ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js 2:0-24 3:15-18 4:0-22 4:0-22


when i use node version 12.13.0 is ok! but 13.0.1 is error

https://stackoverflow.com/questions/59706130/error-package-exports-for-path-to-project-folder-node-modules-babel-helper-c

@haoqunjiang
Copy link
Member

13.0.1 is too old a version. It's a fixed bug in Node nodejs/node#29932

@Kaifuny
Copy link
Author

Kaifuny commented Jan 21, 2020

@sodatea

babel/babel#11006

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

No branches or pull requests

2 participants