2017-02-08 12 views
0

現在、someone on githubで作成されたknexプロジェクトを使用しています。コマンドのpackage.jsonのknexコマンドを実行しようとしました

{ 
    "name": "database", 
    "version": "1.0.0", 
    "description": "## Steps", 
    "main": "index.js", 
    "scripts": { 
    "init": "knex init", 
    "migrate:make": "knex migrate:make", 
    "migrate:latest": "knex migrate:latest", 
    "migrate:rollback": "knex migrate:rollback", 
    "seed:make": "knex seed:make", 
    "seed:run": "knex seed:run", 
    "test": "tape tests.js" 
    }, 
    "author": "", 
    "license": "ISC", 
    "devDependencies": { 
    "tape": "^4.5.1" 
    }, 
    "dependencies": { 
    "knex": "^0.11.5", 
    "sqlite3": "^3.1.4" 
    } 
} 

なし何らかの理由npm testを除いて、私のために動作しません:それはknexが実行しやすいコマンドを作る必要があるように見えるよう

私はpackage.jsonとのトラブルを抱えています。私はknexをグローバルにインストールしようとしましたが(私はそれが必要かどうか分かりません)、私はまだ同じ問題を抱えています。 npm run <script_name>:あなたはscriptsブロックで定義されたスクリプトを実行したい場合は

npm seed:run 

Usage: npm <command> 

where <command> is one of: 
    access, adduser, bin, bugs, c, cache, completion, config, 
    ddp, dedupe, deprecate, dist-tag, docs, edit, explore, get, 
    help, help-search, i, init, install, install-test, it, link, 
    list, ln, login, logout, ls, outdated, owner, pack, ping, 
    prefix, prune, publish, rb, rebuild, repo, restart, root, 
    run, run-script, s, se, search, set, shrinkwrap, star, 
    stars, start, stop, t, tag, team, test, tst, un, uninstall, 
    unpublish, unstar, up, update, v, version, view, whoami 

npm <cmd> -h  quick help on <cmd> 
npm -l   display full usage info 
npm help <term> search for help on <term> 
npm help npm  involved overview 

Specify configs in the ini-formatted file: 
    /root/.npmrc 
or on the command line via: npm <command> --key value 
Config info can be viewed via: npm help config 
+0

エラー出力を教えてください。 – Romain

答えて

2

は、次の構文を使用して、それを実行する必要があります。ここでは

は出力例です。

npm testは、特殊なケースです(例:npm installなど)。

+0

それでした。私はアホです。 – pebblexe

関連する問題