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

Running yarn to install dependencies for development results in an error #612

Closed
wwaaijer-exh opened this issue Apr 28, 2022 · 0 comments · Fixed by #614
Closed

Running yarn to install dependencies for development results in an error #612

wwaaijer-exh opened this issue Apr 28, 2022 · 0 comments · Fixed by #614
Labels
bug Something isn't working

Comments

@wwaaijer-exh
Copy link
Contributor

wwaaijer-exh commented Apr 28, 2022

Description

Cloned the repository to fix a bug. While running yarn to install the dependencies, I received an error.

Steps to Reproduce

  • On a windows machine
  • Clone the repository
  • Run yarn

Code example

PS C:\Users\Wilco\Documents\git\javascript-sdk> yarn
yarn install v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.3.2: The platform "win32" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @rollup/plugin-babel@5.3.1" has unmet peer dependency "@babel/core@^7.0.0".
warning " > @rollup/plugin-typescript@8.3.1" has unmet peer dependency "tslib@*".
[4/4] Building fresh packages...
$ yarn build && husky install
yarn run v1.22.10
$ yarn create-version-file && yarn clean && yarn build:library && yarn create-mock-sdk && yarn build:declarations
$ echo "export const version = '$(node -p "require('./package.json').version")';" > src/version.ts
$ rimraf build
$ rollup --config rollup.config.js

src\index.ts → build\index.cjs.js, build\index.mjs...
(!) Module level directives cause errors when bundled, 'export const version = '$(node -p ' was ignored.
src\version.ts (1:0)
1: "export const version = '$(node -p ";
   ^
2: require('./package.json').version;
3: ")';";
(!) Plugin typescript: @rollup/plugin-typescript TS1005: ';' expected.
src\version.ts: (1:37)

1 "export const version = '$(node -p "require('./package.json').version")';"
                                      ~~~~~~~

src\version.ts: (1:70)

1 "export const version = '$(node -p "require('./package.json').version")';"
                                                                       ~~~~~

[!] Error: 'version' is not exported by src\version.ts, imported by src\client.ts
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
src\client.ts (1:9)
1: import { version as packageVersion } from './version';
            ^
2: import { usersService, authService, dataService, tasksService, filesService, configurationsService, templatesService, mailsService, dispatchersService, paymentsService, localizationsService, profilesService, notificationsService, eventsService, } from './services';
3: import { createHttpClient, createOAuth1HttpClient, parseAuthParams, createOAuth2HttpClient, createProxyHttpClient, } from './http';
Error: 'version' is not exported by src\version.ts, imported by src\client.ts
    at error (C:\Users\Wilco\Documents\git\javascript-sdk\node_modules\rollup\dist\shared\rollup.js:159:30)
    at Module.error (C:\Users\Wilco\Documents\git\javascript-sdk\node_modules\rollup\dist\shared\rollup.js:12437:16)
    at Module.traceVariable (C:\Users\Wilco\Documents\git\javascript-sdk\node_modules\rollup\dist\shared\rollup.js:12795:29)
    at ModuleScope.findVariable (C:\Users\Wilco\Documents\git\javascript-sdk\node_modules\rollup\dist\shared\rollup.js:11416:39)
    at FunctionScope.findVariable (C:\Users\Wilco\Documents\git\javascript-sdk\node_modules\rollup\dist\shared\rollup.js:6392:38)
    at ChildScope.findVariable (C:\Users\Wilco\Documents\git\javascript-sdk\node_modules\rollup\dist\shared\rollup.js:6392:38)
    at Identifier.bind (C:\Users\Wilco\Documents\git\javascript-sdk\node_modules\rollup\dist\shared\rollup.js:7681:40)
    at Property.bind (C:\Users\Wilco\Documents\git\javascript-sdk\node_modules\rollup\dist\shared\rollup.js:5281:23)
    at ObjectExpression.bind (C:\Users\Wilco\Documents\git\javascript-sdk\node_modules\rollup\dist\shared\rollup.js:5277:31)
    at CallExpression.bind (C:\Users\Wilco\Documents\git\javascript-sdk\node_modules\rollup\dist\shared\rollup.js:5277:31)

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/install for documentation about this command.

Specifications

  • Version: 6.1.1
  • Platform: Windows / yarn 1.22.10 / node 14.17.3
  • Endpoint or service affected: n/a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant