Comments (8)
I tried to use the built in help command instead, however I hit a roadblock when generating a new module.
PS C:\Users\username\Documents\project-api-v3> nest generate module common/config
Unexpected string in JSON at position 31
Failed to execute command : @nestjs/schematics:module --name=common/config --dry-run=false, see above.
Failed to execute command : @nestjs/schematics:module --name=common/config --dry-run=false, see above.
PS C:\Users\username\Documents\project-api-v3> nest generate module src/common/config
Unexpected string in JSON at position 31
Failed to execute command : @nestjs/schematics:module --name=src/common/config --dry-run=false, see above.
Failed to execute command : @nestjs/schematics:module --name=src/common/config --dry-run=false, see above.
PS C:\Users\username\Documents\project-api-v3> nest generate module config src/common
Unexpected string in JSON at position 31
Failed to execute command : @nestjs/schematics:module --name=config --path=src/common --dry-run=false, see above.
Failed to execute command : @nestjs/schematics:module --name=config --path=src/common --dry-run=false, see above.
PS C:\Users\username\Documents\project-api-v3> nest --version
4.0.0-rc2
I tried different paths because I wasn't sure what base path it would try to use. Any idea what I am doing wrong?
With the stable 3.x version I had the same issue, which had been closed here: #61 . Apparently it hasn't been fixed by the rewrite unless I am doing something wrong?
from nest-cli.
The documentation is not yet published
You ca see the repository https://github.com/nestjs/docs.nestjs.com to follow when it will be published
from nest-cli.
seems to be the module import that cause this issue...
I'll reproduce it and find a way to fix it one time at all ;-)
from nest-cli.
Can't reproduce the bug on a VM with Windows 10 version...
Can you bring nest info ?
Your app.module.ts file maybe ?
from nest-cli.
The app.module.ts:
import { HelmetMiddleware } from '@nest-middlewares/helmet';
import { MiddlewaresConsumer, Module, RequestMethod } from '@nestjs/common';
import { ConfigModule } from './common/config/config.module';
import { AuthMiddleware } from './middlewares/auth/auth-middleware';
import { AuthService } from './middlewares/auth/auth.service';
import { JwtStrategy } from './middlewares/auth/passport/jwt.strategy';
import { PlayersModule } from './routes/players/players.module';
@Module({
imports: [ConfigModule, PlayersModule],
controllers: [],
components: [AuthService, JwtStrategy]
})
export class AppModule {
public configure(consumer: MiddlewaresConsumer): void {
consumer
.apply(HelmetMiddleware)
.forRoutes({ path: '*', method: RequestMethod.GET })
.apply(AuthMiddleware)
.forRoutes({ path: '*', method: RequestMethod.GET });
}
}
from nest-cli.
Test written to check what happens !
Hope this will be quickly fixed !
from nest-cli.
Try to release today to enjoy the cli with the fix ;-)
from nest-cli.
Please upgrade to 4.0.0 or 5.0.0 depends on the Nestjs major version you want to use
from nest-cli.
Related Issues (20)
- Regression > Copying assets is broken on Windows devices
- Facing module unavailability error on changing the bundler to swc HOT 1
- odd behavior when the config file can't be read HOT 5
- Add remove command to delete a non-root project from monorepo and auto-update nest-cli.json HOT 2
- false-positive warning message for `@nestjs/schematics` HOT 1
- [Feature] - nestCLI option to generate Command and Events HOT 1
- Update gitignore to include more common files or folders HOT 5
- The `roodDir` compiler option not being respected when using SWC HOT 7
- add "compilerOptions.sourceMaps" option is nest-cli-json HOT 1
- Assets only works on top level project. HOT 1
- Clean up dependencies HOT 1
- Listing all the routes/endpoints with their types and middleware in project HOT 2
- Error cause is not logged in dev:watch mode HOT 1
- broken path in build output HOT 4
- CLI not work whit PowerShell HOT 3
- ERROR [I18nService] parsing translation error in 10.3.2 HOT 12
- Unable to upgrade to the latest version, node version is v16.20.2
- Add an option to skip testing and linting packages/configurations when creating a new project. HOT 2
- Class generator creating file inside non specified folder on Windows 11 HOT 4
- Critical Security Vulnerability in formidable version used by superagent and supertest HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nest-cli.