mulesoft-labs / api-console-cli

A CLI tools for the API console.
Other
14 stars 15 forks source link

error: Command failed: node_modules/.bin/rollup -c rollup.config.js #50

Closed awesomeousPrime closed 3 years ago

awesomeousPrime commented 3 years ago

Hello,

I'm having this one issue when running the following:

npm install -g api-console-cli
wget -O api.raml https://raw.githubusercontent.com/raml-org/raml-examples/master/helloworld/helloworld.raml
api-console build -t "RAML 1.0" ./api.raml

I keep encountering the following error:

error:
error: Command failed: node_modules/.bin/rollup -c rollup.config.js

/tmp/tmp-5925-A9nU06t85s8K/index.html → dist, dist...
[!] (plugin babel) TypeError: unknown: Cannot read property '_inherits' of undefined
TypeError: unknown: Cannot read property '_inherits' of undefined
    at Object.push (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/helper-define-map/lib/index.js:39:23)
    at pushToMap (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/plugin-transform-classes/lib/transformClass.js:96:27)
    at pushMethod (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/plugin-transform-classes/lib/transformClass.js:374:5)
    at pushBody (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/plugin-transform-classes/lib/transformClass.js:191:11)
    at buildBody (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/plugin-transform-classes/lib/transformClass.js:135:5)
    at classTransformer (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/plugin-transform-classes/lib/transformClass.js:544:5)
    at transformClass (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/plugin-transform-classes/lib/transformClass.js:580:10)
    at PluginPass.ClassExpression (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/plugin-transform-classes/lib/index.js:63:54)
    at newFn (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/traverse/lib/visitors.js:175:21)
    at NodePath._call (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/traverse/lib/path/context.js:55:20)

error: Error: Command failed: node_modules/.bin/rollup -c rollup.config.js

/tmp/tmp-5925-A9nU06t85s8K/index.html → dist, dist...
[!] (plugin babel) TypeError: unknown: Cannot read property '_inherits' of undefined
TypeError: unknown: Cannot read property '_inherits' of undefined
    at Object.push (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/helper-define-map/lib/index.js:39:23)
    at pushToMap (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/plugin-transform-classes/lib/transformClass.js:96:27)
    at pushMethod (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/plugin-transform-classes/lib/transformClass.js:374:5)
    at pushBody (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/plugin-transform-classes/lib/transformClass.js:191:11)
    at buildBody (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/plugin-transform-classes/lib/transformClass.js:135:5)
    at classTransformer (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/plugin-transform-classes/lib/transformClass.js:544:5)
    at transformClass (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/plugin-transform-classes/lib/transformClass.js:580:10)
    at PluginPass.ClassExpression (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/plugin-transform-classes/lib/index.js:63:54)
    at newFn (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/traverse/lib/visitors.js:175:21)
    at NodePath._call (/tmp/tmp-5925-A9nU06t85s8K/node_modules/@babel/traverse/lib/path/context.js:55:20)

    at ChildProcess.exithandler (child_process.js:294:12)
    at ChildProcess.emit (events.js:198:13)
    at ChildProcess.EventEmitter.emit (domain.js:448:20)
    at maybeClose (internal/child_process.js:982:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
error:

I'm using the following versions of node and the api-console:

root@1dc4034b2040:/# api-console --version
2.1.2
root@1dc4034b2040:/# node --version
v10.23.1

Does anyone know why this is happening, and if there's something I'm missing?

jarrodek commented 3 years ago

Hi, Thank you for reporting the issue. I will try to reproduce this and will get back to you. From the looks of the logs, it might be an issue with one of the Rollup plugins. But I can't be sure right now.

eyoboue commented 3 years ago

Hello, I have the same issue

awesomeousPrime commented 3 years ago

Hello @jarrodek, any update on this issue?

jarrodek commented 3 years ago

Hi @awesomeousPrime and @eyoboue Sorry for the late response. GitHub stopped sending me any notifications about responses. I have to walk through all issues manually... I fixed the issue already and released the update a few days ago. You can again use the builder. Please, update the CLI tool to version 3.0.0 with npm i -g api-console-cli.

eyoboue commented 3 years ago

Hello, I still have the same error

~ node -v
v12.15.0
~ yarn --version
1.22.10
~ npm --version
6.13.4
─ api-console-cli@3.0.0
└─ api-console@6.4.9
api-console build -a ./resources/raml/api.raml -t 'RAML 1.0' -o ./api-console --strict --no-cache
cross-env NODE_ENV=development yarn run build-console && nodemon ./index.js --watch
$ yarn run api-console build -a ./resources/raml/api.raml -t 'RAML 1.0' -o ./api-console --no-cache
$ ./node_modules/.bin/api-console build -a ./resources/raml/api.raml -t 'RAML 1.0' -o ./api-console --no-cache
warn: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN lifecycle The node binary used for scripts is /var/folders/95/qm8j4v3x72j8b5yr_np35m680000gn/T/yarn--1619698658201-0.610891915831224/node but npm is using /Users/eyoboue/.nvm/versions/node/v12.15.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
npm notice created a lockfile as package-lock.json. You should commit this file.

warn: npm WARN deprecated nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
npm WARN deprecated @advanced-rest-client/multipart-payload-editor@4.1.0: This element is deprecated. Use @advanced-rest-client/body-editor instead.
npm WARN deprecated @advanced-rest-client/files-payload-editor@3.1.0: This element is deprecated. Use @advanced-rest-client/body-editor instead.
npm WARN deprecated @advanced-rest-client/payload-parser-mixin@3.0.0: This element is deprecated. Use @advanced-rest-client/body-editor instead.
npm WARN lifecycle The node binary used for scripts is /var/folders/95/qm8j4v3x72j8b5yr_np35m680000gn/T/yarn--1619698658201-0.610891915831224/node but npm is using /Users/eyoboue/.nvm/versions/node/v12.15.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
npm WARN @advanced-rest-client/arc-icons@3.3.3 requires a peer of @polymer/iron-icon@^3.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN @advanced-rest-client/arc-icons@3.3.3 requires a peer of @polymer/iron-iconset-svg@^3.0.1 but none is installed. You must install peer dependencies yourself.

error:
error: Command failed: node_modules/.bin/rollup -c rollup.config.js
[!] Error: While loading the Rollup configuration from "rollup.config.js", Node tried to require an ES module from a CommonJS file, which is not supported. A common cause is if there is a package.json file with "type": "module" in the same folder. You can try to fix this by changing the extension of your configuration file to ".cjs" or ".mjs" depending on the content, which will prevent Rollup from trying to preprocess the file but rather hand it to Node directly.
https://rollupjs.org/guide/en/#using-untranspiled-config-files
Error: While loading the Rollup configuration from "rollup.config.js", Node tried to require an ES module from a CommonJS file, which is not supported. A common cause is if there is a package.json file with "type": "module" in the same folder. You can try to fix this by changing the extension of your configuration file to ".cjs" or ".mjs" depending on the content, which will prevent Rollup from trying to preprocess the file but rather hand it to Node directly.
    at Object.error (/private/var/folders/95/qm8j4v3x72j8b5yr_np35m680000gn/T/tmp-62164-Q3S8R75ck75q/node_modules/rollup/dist/shared/rollup.js:5305:30)
    at loadConfigFromBundledFile (/private/var/folders/95/qm8j4v3x72j8b5yr_np35m680000gn/T/tmp-62164-Q3S8R75ck75q/node_modules/rollup/dist/shared/loadConfigFile.js:554:27)
    at getDefaultFromTranspiledConfigFile (/private/var/folders/95/qm8j4v3x72j8b5yr_np35m680000gn/T/tmp-62164-Q3S8R75ck75q/node_modules/rollup/dist/shared/loadConfigFile.js:532:12)
    at loadConfigFile (/private/var/folders/95/qm8j4v3x72j8b5yr_np35m680000gn/T/tmp-62164-Q3S8R75ck75q/node_modules/rollup/dist/shared/loadConfigFile.js:497:15)
    at Object.loadAndParseConfigFile (/private/var/folders/95/qm8j4v3x72j8b5yr_np35m680000gn/T/tmp-62164-Q3S8R75ck75q/node_modules/rollup/dist/shared/loadConfigFile.js:476:21)
    at getConfigs (/private/var/folders/95/qm8j4v3x72j8b5yr_np35m680000gn/T/tmp-62164-Q3S8R75ck75q/node_modules/rollup/dist/bin/rollup:1685:39)
    at runRollup (/private/var/folders/95/qm8j4v3x72j8b5yr_np35m680000gn/T/tmp-62164-Q3S8R75ck75q/node_modules/rollup/dist/bin/rollup:1659:43)

error: Error: Command failed: node_modules/.bin/rollup -c rollup.config.js
[!] Error: While loading the Rollup configuration from "rollup.config.js", Node tried to require an ES module from a CommonJS file, which is not supported. A common cause is if there is a package.json file with "type": "module" in the same folder. You can try to fix this by changing the extension of your configuration file to ".cjs" or ".mjs" depending on the content, which will prevent Rollup from trying to preprocess the file but rather hand it to Node directly.
https://rollupjs.org/guide/en/#using-untranspiled-config-files
Error: While loading the Rollup configuration from "rollup.config.js", Node tried to require an ES module from a CommonJS file, which is not supported. A common cause is if there is a package.json file with "type": "module" in the same folder. You can try to fix this by changing the extension of your configuration file to ".cjs" or ".mjs" depending on the content, which will prevent Rollup from trying to preprocess the file but rather hand it to Node directly.
    at Object.error (/private/var/folders/95/qm8j4v3x72j8b5yr_np35m680000gn/T/tmp-62164-Q3S8R75ck75q/node_modules/rollup/dist/shared/rollup.js:5305:30)
    at loadConfigFromBundledFile (/private/var/folders/95/qm8j4v3x72j8b5yr_np35m680000gn/T/tmp-62164-Q3S8R75ck75q/node_modules/rollup/dist/shared/loadConfigFile.js:554:27)
    at getDefaultFromTranspiledConfigFile (/private/var/folders/95/qm8j4v3x72j8b5yr_np35m680000gn/T/tmp-62164-Q3S8R75ck75q/node_modules/rollup/dist/shared/loadConfigFile.js:532:12)
    at loadConfigFile (/private/var/folders/95/qm8j4v3x72j8b5yr_np35m680000gn/T/tmp-62164-Q3S8R75ck75q/node_modules/rollup/dist/shared/loadConfigFile.js:497:15)
    at Object.loadAndParseConfigFile (/private/var/folders/95/qm8j4v3x72j8b5yr_np35m680000gn/T/tmp-62164-Q3S8R75ck75q/node_modules/rollup/dist/shared/loadConfigFile.js:476:21)
    at getConfigs (/private/var/folders/95/qm8j4v3x72j8b5yr_np35m680000gn/T/tmp-62164-Q3S8R75ck75q/node_modules/rollup/dist/bin/rollup:1685:39)
    at runRollup (/private/var/folders/95/qm8j4v3x72j8b5yr_np35m680000gn/T/tmp-62164-Q3S8R75ck75q/node_modules/rollup/dist/bin/rollup:1659:43)

    at ChildProcess.exithandler (child_process.js:295:12)
    at ChildProcess.emit (events.js:223:5)
    at ChildProcess.EventEmitter.emit (domain.js:475:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
error:
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2904481899 commented 1 year ago

我也是同样的问题