You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/bin/bash
cli="@nestjs/cli@${1:-latest}"
maints=$(
cat <<'EOF'
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
export async function bootstrap(port) {
const app = await NestFactory.create(AppModule, { logger: false });
await app.listen(port);
return app
}
EOF
)
appts=$(
cat <<'EOF'
import { Controller, Get, Req } from '@nestjs/common';
import { AppService } from './app.service';
import { Request } from 'express'
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@Get()
getHello(@Req() request: Request): string {
if (request?.query?.please_error === 'yes') {
throw new Error('erroring out, as requested')
}
return this.appService.getHello();
}
}
EOF
)
echo ${maints} > main.ts
echo ${appts} > app.controller.ts
rm -rf test-app 2>/dev/null
npx ${cli} new --package-manager npm --skip-git test-app
cd test-app
npx ${cli} build
Run ./run.sh 10 and we'll get:
▹▹▹▸▹ Installation in progress... ☕
Failed to execute command: npm install --silent
✖ Installation in progress... ☕
🙀 Packages installation failed!
In case you don't see any errors above, consider manually running the failed command npm install to see more details on why it errored out.
Thanks for installing Nest 🙏
Please consider donating to our open collective
to help us maintain this package.
🍷 Donate: https://opencollective.com/nest
src/app.controller.ts:1:33 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.
1 import { Controller, Get } from '@nestjs/common';
~~~~~~~~~~~~~~~~
src/app.module.ts:1:24 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.
1 import { Module } from '@nestjs/common';
~~~~~~~~~~~~~~~~
src/app.service.ts:1:28 - error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.
1 import { Injectable } from '@nestjs/common';
~~~~~~~~~~~~~~~~
src/main.ts:1:29 - error TS2307: Cannot find module '@nestjs/core' or its corresponding type declarations.
1 import { NestFactory } from '@nestjs/core';
~~~~~~~~~~~~~~
src/main.ts:6:20 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
6 await app.listen(process.env.PORT ?? 3000);
~~~~~~~
Found 5 error(s).
If we navigate into the test-app directory and run npm install --verbose we'll get:
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/typescript
npm error dev typescript@"^5.1.3" from the root project
npm error peer typescript@">=4.8.2" from @nestjs/[email protected]
npm error node_modules/@nestjs/schematics
npm error dev @nestjs/schematics@"^10.0.0" from the root project
npm error @nestjs/schematics@"^10.0.1" from @nestjs/[email protected]
npm error node_modules/@nestjs/cli
npm error dev @nestjs/cli@"^10.0.0" from the root project
npm error
npm error Could not resolve dependency:
npm error dev @typescript-eslint/eslint-plugin@"^8.0.0" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/typescript
npm error peer typescript@">=4.8.4 <5.8.0" from @typescript-eslint/[email protected]
npm error node_modules/@typescript-eslint/eslint-plugin
npm error dev @typescript-eslint/eslint-plugin@"^8.0.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
Expected behavior
npm install in a bootstrapped directory works without failure.
Package version
10.x
NestJS version
No response
Node.js version
No response
In which operating systems have you tested?
macOS
Windows
Linux
Other
No response
The text was updated successfully, but these errors were encountered:
If you really need to use v10, run npm i --legacy-peer-deps as there seems to be a minor (irrelevant) peer dep versions conflict (caused by @typescript-eslint/eslint-plugin). This isn't related to NestJS
Is there an existing issue for this?
Current behavior
I think this might be similar to #2937, but I am not sure. See reproduction for details.
Minimum reproduction code
https://example.com
Steps to reproduce
Using the following:
run.sh:
Run
./run.sh 10
and we'll get:If we navigate into the
test-app
directory and runnpm install --verbose
we'll get:Expected behavior
npm install
in a bootstrapped directory works without failure.Package version
10.x
NestJS version
No response
Node.js version
No response
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: