如何解决打字稿只能找到类CI
我有一个 Angular 项目,当我在本地运行“ ng test”时,一切正常,但是在bitbucket管道中却出现此错误。
src / app / services / user-store / user.service.ts中的ERROR:7:22-错误 TS2307:找不到模块“ ../../models/user”或其对应的模块 类型声明。 7从'../../models/user'导入{User};
我的tsconfig.base
{
"compileOnSave": false,"compilerOptions": {
"baseUrl": "./","outDir": "./dist/out-tsc","sourceMap": true,"declaration": false,"downlevelIteration": true,"experimentalDecorators": true,"moduleResolution": "node","importHelpers": true,"target": "es2015","module": "es2020","lib": [
"es2018","dom"
]
}
}
我的tsconfig.spec.json
{
"extends": "./tsconfig.base.json","compilerOptions": {
"outDir": "./out-tsc/spec","types": [
"jasmine"
]
},"files": [
"src/test.ts","src/polyfills.ts"
],"include": [
"src/**/*.spec.ts","src/**/*.d.ts"
]
}
我认为与tsconfig.base中的“目标”有关,但我不确定,也许我的Yaml中缺少某些内容?
bitbucket-pipelines.yml
pipelines:
default:
- step:
name: Build,Lint and Test
image: rastasheep/alpine-node-chromium:12-alpine
caches:
- node
deployment: test
script:
- npm install
- npm run test:ci
- npm run e2e:ci
- npm run build:prod
- pipe: atlassian/firebase-deploy:0.3.0
variables:
FIREBASE_TOKEN: '$FIREBASE_TOKEN_CI'
User.ts
import * as firebase from 'firebase';
export interface User{
uid: string;
name: string;
email: string;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。