Open bburns opened 2 weeks ago
I cloned nango recently and ran ts-build - it fails at the cli's copy:types script -
in git-bash -
[/c/Users/bburns/Workspace/forks/nango] $ npm run ts-build > @nangohq/nango@0.39.32 ts-build > tsc -b tsconfig.build.json && npm run -w nango postbuild > nango@0.40.0 postbuild > npm run copy:types > nango@0.40.0 copy:types > cp `node -p "require.resolve('@nangohq/shared/dist/sdk/sync.d.ts')"` './dist/nango-sync.d.ts' cp: target './dist/nango-sync.d.ts' is not a directory npm error Lifecycle script `copy:types` failed with error: npm error code 1 npm error path C:\Users\bburns\Workspace\forks\nango\packages\cli npm error workspace nango@0.40.0 npm error location C:\Users\bburns\Workspace\forks\nango\packages\cli npm error command failed npm error command C:\WINDOWS\system32\cmd.exe /d /s /c cp `node -p "require.resolve('@nangohq/shared/dist/sdk/sync.d.ts')"` './dist/nango-sync.d.ts' npm error Lifecycle script `postbuild` failed with error: npm error code 1 npm error path C:\Users\bburns\Workspace\forks\nango\packages\cli npm error workspace nango@0.40.0 npm error location C:\Users\bburns\Workspace\forks\nango\packages\cli npm error command failed npm error command C:\WINDOWS\system32\cmd.exe /d /s /c npm run copy:types
in command prompt -
C:\Users\bburns\Workspace\forks\nango > npm run ts-build > @nangohq/nango@0.39.32 ts-build > tsc -b tsconfig.build.json && npm run -w nango postbuild > nango@0.40.0 postbuild > npm run copy:types > nango@0.40.0 copy:types > cp `node -p "require.resolve('@nangohq/shared/dist/sdk/sync.d.ts')"` './dist/nango-sync.d.ts' 'cp' is not recognized as an internal or external command, operable program or batch file. npm error Lifecycle script `copy:types` failed with error: npm error code 1 npm error path C:\Users\bburns\Workspace\forks\nango\packages\cli npm error workspace nango@0.40.0 npm error location C:\Users\bburns\Workspace\forks\nango\packages\cli npm error command failed npm error command C:\WINDOWS\system32\cmd.exe /d /s /c cp `node -p "require.resolve('@nangohq/shared/dist/sdk/sync.d.ts')"` './dist/nango-sync.d.ts' npm error Lifecycle script `postbuild` failed with error: npm error code 1 npm error path C:\Users\bburns\Workspace\forks\nango\packages\cli npm error workspace nango@0.40.0 npm error location C:\Users\bburns\Workspace\forks\nango\packages\cli npm error command failed npm error command C:\WINDOWS\system32\cmd.exe /d /s /c npm run copy:types
A fix - in packages/cli/package.json change
packages/cli/package.json
"copy:types": "cp `node -p \"require.resolve('@nangohq/shared/dist/sdk/sync.d.ts')\"` './dist/nango-sync.d.ts'", to "copy:types": "node -r fs -e \"fs.cpSync(require.resolve('@nangohq/shared/dist/sdk/sync.d.ts'), './dist/nango-sync.d.ts')\"",
NAN-1215 'npm run ts-build' fails on Windows in git-bash and command prompt
I cloned nango recently and ran ts-build - it fails at the cli's copy:types script -
in git-bash -
in command prompt -
A fix - in
packages/cli/package.json
change